Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
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(string, sizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",GetPlayerIp(targetid, playerIP, sizeof(playerIP)),PlayerData[playerid][pIP],GetPlayerPing(playerid));
SendClientMessage(playerid,BLUE,string);
Re: Please help with GetPlayerIp -
Vince - 14.07.2016
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().
Re: Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
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?
Re: Please help with GetPlayerIp -
Freaksken - 14.07.2016
Quote:
Originally Posted by TayFunCZE
OK, and can you help me with code please? ![Smiley](images/smilies/smile.png)
|
You can find a complete example on the
wiki.
There is a wiki for SA-MP, use it.
Re: Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
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 -_-
Re: Please help with GetPlayerIp -
AbyssMorgan - 14.07.2016
PHP код:
GetPlayerIp(targetid, playerIP, sizeof(playerIP));
format(string, sizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",playerIP,PlayerData[playerid][pIP],GetPlayerPing(playerid));
SendClientMessage(playerid,BLUE,string);
Re: Please help with GetPlayerIp -
Crayder - 14.07.2016
new str[16];
GetPlayerIp(playerid, str, sizeof str);
//now use 'str', which is the IP
Re: Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
Quote:
Originally Posted by AbyssMorgan
PHP код:
GetPlayerIp(targetid, playerIP, sizeof(playerIP));
format(string, sizeof(string), "[NORMAL IP - %s][REG IP - %s][PING: %d]",playerIP,PlayerData[playerid][pIP],GetPlayerPing(playerid));
SendClientMessage(playerid,BLUE,string);
|
OK, thanks man..
Re: Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
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?
Re: Please help with GetPlayerIp -
TayFunCZE - 14.07.2016
FIXED - 100% working, thank you everybody who help