SA-MP Forums Archive
Get Players IP - 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: Get Players IP (/showthread.php?tid=204134)



Get Players IP - BlackWolf120 - 28.12.2010

hi,
im trying to display the players ip right after connect but theres one error:

pawn Код:
error 001: expected token: ";", but found "-identifier-"

new ipstring[16],ipst[40];
GetPlayerIp(playerid,ipstring,255)
format(ipst, sizeof(ipst), "Welcome, your current IP is: %s",ipstring); //here
SendClientMessage(playerid,0xFFFF00FF, ipst);
hope u can tell me what it is.

regards.


Re: Get Players IP - _rAped - 28.12.2010

pawn Код:
GetPlayerIp(playerid,ipstring,sizeof(ipstring));
You missed the ;


Re: Get Players IP - Hal - 28.12.2010

Please don't show their ip publicly. If you really want this, show it only to admins. I HATE it when the whole server sees it.


Re: Get Players IP - _rAped - 28.12.2010

Quote:
Originally Posted by Hal
Посмотреть сообщение
Please don't show their ip publicly. If you really want this, show it only to admins. I HATE it when the whole server sees it.
If you read the code, it displays the playerip to the player himself.


Re: Get Players IP - BlackWolf120 - 28.12.2010

yeah, it displays the players ip to the player only.

ah, didnt see that, cause it said the error was in the line above.

mhh, as soon as i connect to the server, the server crashes, why??


Re: Get Players IP - _rAped - 28.12.2010

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
yeah, it displays the players ip to the player only.

ah, didnt see that, cause it said the error was in the line above.

mhh, as soon as i connect to the server, the server crashes, why??
Don't know. Has nothing to do with this code I guess.


Re: Get Players IP - BlackWolf120 - 28.12.2010

i put the code under OnPlayerSpawn and now it works.
thanks


Re: Get Players IP - DVDK - 28.12.2010

Quote:

GetPlayerIp(playerid,ipstring,255)

Because a player IP can never be 255 characters long? try 16.


Re: Get Players IP - BlackWolf120 - 28.12.2010

oh ok thanks
actually wanted to type 25

regards...