Get Players IP
#1

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

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

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

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

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

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

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

Quote:

GetPlayerIp(playerid,ipstring,255)

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

oh ok thanks
actually wanted to type 25

regards...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)