SA-MP Forums Archive
IP doesnt show correctly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IP doesnt show correctly (/showthread.php?tid=121845)



IP doesnt show correctly - HydraX - 18.01.2010

pawn Code:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
  new tempstring[250];
  new plrIP[16];
  GetPlayerName(playerid,tempstring,sizeof(tempstring));
  format(tempstring,sizeof(tempstring),"%s's Stats\n\nScore: %d       (Players Current Score)\nJailed: %d       (0 meaning NO, 1 meaning YES)\nAdmin: %d       (The admin level of the player)\nMoney: %d       The current money the player has)\nIP: %d",tempstring,PlayerInfo[playerid][Score], PlayerInfo[playerid][Jailed], PlayerInfo[playerid][Level], GetPlayerMoney(playerid), GetPlayerIp(playerid, plrIP, sizeof(plrIP)));
  ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Stats",tempstring,"","Close");
      return 1;
}
Screenshot..




Re: IP doesnt show correctly - Vetle - 18.01.2010

try increasing tempstring


Re: IP doesnt show correctly - HydraX - 18.01.2010

Quote:
Originally Posted by Vetle
try increasing tempstring
That has nothing to do with the IP, It has its own String...


Re: IP doesnt show correctly - Joe Staff - 18.01.2010

That's not how you use the GetPlayerIp function

pawn Code:
new pIP[16];
GetPlayerIp(playerid,pIP);
print(pIP);



Re: IP doesnt show correctly - GTAguillaume - 18.01.2010

pawn Code:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
  new tempstring[250];
  new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP))
  GetPlayerName(playerid,tempstring,sizeof(tempstring));
  format(tempstring,sizeof(tempstring),"%s's Stats\n\nScore: %d       (Players Current Score)\nJailed: %d       (0 meaning NO, 1 meaning YES)\nAdmin: %d       (The admin level of the player)\nMoney: %d       The current money the player has)\nIP: %s",tempstring,PlayerInfo[playerid][Score], PlayerInfo[playerid][Jailed], PlayerInfo[playerid][Level], GetPlayerMoney(playerid), plrIP);
  ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"Stats",tempstring,"","Close");
      return 1;
}
More info



Re: IP doesnt show correctly - HydraX - 18.01.2010

Quote:
Originally Posted by Joe Staff
That's not how you use the GetPlayerIp function

pawn Code:
new pIP[16];
GetPlayerIp(playerid,pIP);
print(pIP);
Then the wiki is wrong..


Re: IP doesnt show correctly - Double-O-Seven - 18.01.2010

IP: %s not IP: %d


Re: IP doesnt show correctly - Correlli - 18.01.2010

No, the wiki is right.

This is how you should use it:
pawn Code:
new
    playerIp[16];
GetPlayerIp(playerid, playerIp, sizeof(playerIp));



Re: IP doesnt show correctly - HydraX - 18.01.2010

Quote:
Originally Posted by Double-O-Seven
IP: %s not IP: %d
No, it doesn't show..


Re: IP doesnt show correctly - HydraX - 18.01.2010

Nvm, it didn't work..