SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 18/01/2010, 07:15 PM   #1
HydraX
Gangsta
 
Join Date: Mar 2009
Location: Don`t stalk me..
Posts: 894
Reputation: 18
Default IP doesnt show correctly

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

__________________
kthxbai.
http://pastebin.com/cLxes1HM

West Coast Generation - Alpha [0.3e]
108.213.37.171:7777
HydraX is offline  
Old 18/01/2010, 07:19 PM   #2
Vetle
Big Clucker
 
Join Date: Oct 2007
Location: https://steamcommunity.com/id/vetleledaal/
Posts: 135
Reputation: 6
Default Re: IP doesnt show correctly

try increasing tempstring
Vetle is offline  
Old 18/01/2010, 07:20 PM   #3
HydraX
Gangsta
 
Join Date: Mar 2009
Location: Don`t stalk me..
Posts: 894
Reputation: 18
Default Re: IP doesnt show correctly

Quote:
Originally Posted by Vetle
try increasing tempstring
That has nothing to do with the IP, It has its own String...
__________________
kthxbai.
http://pastebin.com/cLxes1HM

West Coast Generation - Alpha [0.3e]
108.213.37.171:7777
HydraX is offline  
Old 18/01/2010, 07:22 PM   #4
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: IP doesnt show correctly

That's not how you use the GetPlayerIp function

pawn Code:
new pIP[16];
GetPlayerIp(playerid,pIP);
print(pIP);
Joe Staff is offline  
Old 18/01/2010, 07:22 PM   #5
GTAguillaume
Big Clucker
 
Join Date: Oct 2009
Posts: 123
Reputation: 0
Default Re: IP doesnt show correctly

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
GTAguillaume is offline  
Old 18/01/2010, 07:23 PM   #6
HydraX
Gangsta
 
Join Date: Mar 2009
Location: Don`t stalk me..
Posts: 894
Reputation: 18
Default Re: IP doesnt show correctly

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..
__________________
kthxbai.
http://pastebin.com/cLxes1HM

West Coast Generation - Alpha [0.3e]
108.213.37.171:7777
HydraX is offline  
Old 18/01/2010, 07:23 PM   #7
Double-O-Seven
Guest
 
Posts: n/a
Default Re: IP doesnt show correctly

IP: %s not IP: %d
 
Old 18/01/2010, 07:24 PM   #8
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 6,340
Reputation: 365
Default Re: IP doesnt show correctly

No, the wiki is right.

This is how you should use it:
pawn Code:
new
    playerIp[16];
GetPlayerIp(playerid, playerIp, sizeof(playerIp));
Correlli is offline  
Old 18/01/2010, 07:25 PM   #9
HydraX
Gangsta
 
Join Date: Mar 2009
Location: Don`t stalk me..
Posts: 894
Reputation: 18
Default Re: IP doesnt show correctly

Quote:
Originally Posted by Double-O-Seven
IP: %s not IP: %d
No, it doesn't show..
__________________
kthxbai.
http://pastebin.com/cLxes1HM

West Coast Generation - Alpha [0.3e]
108.213.37.171:7777
HydraX is offline  
Old 18/01/2010, 07:26 PM   #10
HydraX
Gangsta
 
Join Date: Mar 2009
Location: Don`t stalk me..
Posts: 894
Reputation: 18
Default Re: IP doesnt show correctly

Nvm, it didn't work..
__________________
kthxbai.
http://pastebin.com/cLxes1HM

West Coast Generation - Alpha [0.3e]
108.213.37.171:7777
HydraX is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textdraw doesnt show up?! ÄitisOnHuora Help Archive 4 23/03/2010 04:24 PM
Objects' doesnt show up Julian2574 Help Archive 22 07/02/2010 06:45 AM
my server doesnt show up for friends.... Insict Server Support 5 12/01/2010 04:52 AM
GameTextForPlayer doesnt show up MarqueZ92 Help Archive 29 24/06/2009 02:09 PM


All times are GMT. The time now is 12:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.