Portal SAMP
[Ajuda] Ip - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Ip (/showthread.php?tid=1509)



Ip - WeebSide - 09/08/2021

Qual funçao responssavel por getar o ip do player?

(09/08/2021 19:02)WeebSide Escreveu: Qual funçao responssavel por getar o ip do player?

Código:
new IP[16], str[256];
    new IpPlayer = GetPlayerIp(playerid, IP, sizeof(IP));
    format(str, sizeof(str), "ip: %s", IpPlayer);
    SetPlayerChatBubble(playerid, str, -1, 30, 10000);
Tentei isso nao da erro mas n mostra o ip

Tentei assim tbm mas mostra so 2 numeros

Código:
new IP[16], str[256];
    
    format(str, sizeof(str), "ip: %i", GetPlayerIp(playerid, IP, sizeof(IP)));
    SetPlayerChatBubble(playerid, str, -1, 30, 10000);



RE: Ip - MarcosBrazz - 10/08/2021

A função GetPlayerIp não funciona assim.
Ela não precisa de um "ID"
Basta fazer assim:
Código:
new IP[16], str[256];
    GetPlayerIp(playerid, IP, sizeof(IP));
    format(str, sizeof(str), "ip: %s", IP);
    SetPlayerChatBubble(playerid, str, -1, 30, 10000);