Please help with GetPlayerIp
#1

Hello, this code is working, but "NORMAL IP" and "REG IP" wasn't show player's IP, it's empty.
Please help me what is bad.
PHP код:
format(stringsizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",GetPlayerIp(targetidplayerIPsizeof(playerIP)),PlayerData[playerid][pIP],GetPlayerPing(playerid));
SendClientMessage(playerid,BLUE,string); 
Reply
#2

GetPlayerIp itself only returns 0 or 1 depending on whether the player is connected. It cannot be used inline like that. The result is stored in the variable that is passed as the second parameter (playerIP) and it is this value that you will want to use in format().
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
GetPlayerIp itself only returns 0 or 1 depending on whether the player is connected. It cannot be used inline like that. The result is stored in the variable that is passed as the second parameter (playerIP) and it is this value that you will want to use in format().
OK, and can you help me with code please?
Reply
#4

Quote:
Originally Posted by TayFunCZE
Посмотреть сообщение
OK, and can you help me with code please?
You can find a complete example on the wiki.
There is a wiki for SA-MP, use it.
Reply
#5

Quote:
Originally Posted by Freaksken
Посмотреть сообщение
You can find a complete example on the wiki.
There is a wiki for SA-MP, use it.
I used it -_-
Reply
#6

PHP код:
GetPlayerIp(targetidplayerIPsizeof(playerIP));
format(stringsizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",playerIP,PlayerData[playerid][pIP],GetPlayerPing(playerid)); 
SendClientMessage(playerid,BLUE,string); 
Reply
#7

new str[16];
GetPlayerIp(playerid, str, sizeof str);
//now use 'str', which is the IP
Reply
#8

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
GetPlayerIp(targetidplayerIPsizeof(playerIP));
format(stringsizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",playerIP,PlayerData[playerid][pIP],GetPlayerPing(playerid)); 
SendClientMessage(playerid,BLUE,string); 
OK, thanks man..
Reply
#9

Quote:
Originally Posted by Crayder
Посмотреть сообщение
new str[16];
GetPlayerIp(playerid, str, sizeof str);
//now use 'str', which is the IP
I can't use playerIP?
Reply
#10

FIXED - 100% working, thank you everybody who help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)