IP of a player.
#5

No, you need to declare a string where you will store the formatted string, the correct way is:
pawn Код:
new IPString[16], string[128] playername[MAX_PLAYER_NAME]; // Declare a new array for storing the formatted string
GetPlayerIp(playerid, IPString, sizeof(IPString));
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s has joined the server. IP: %s", playername, IPString);
SendClientMessage(playerid, WHITE, string);
EDIT: fixed code now, I didn't see that the playername array was missing.
Reply


Messages In This Thread
IP of a player. - by iGetty - 07.08.2011, 20:48
Re: IP of a player. - by JaTochNietDan - 07.08.2011, 20:52
Re: IP of a player. - by Anzipane! - 07.08.2011, 20:53
Re: IP of a player. - by iGetty - 07.08.2011, 20:56
Re: IP of a player. - by Anzipane! - 07.08.2011, 21:01
Re: IP of a player. - by iGetty - 07.08.2011, 21:02
Re: IP of a player. - by Basicz - 07.08.2011, 21:03

Forum Jump:


Users browsing this thread: 5 Guest(s)