IP doesnt show correctly
#1

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..

Reply
#2

try increasing tempstring
Reply
#3

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

That's not how you use the GetPlayerIp function

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

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
Reply
#6

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..
Reply
#7

IP: %s not IP: %d
Reply
#8

No, the wiki is right.

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

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

Nvm, it didn't work..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)