10.06.2011, 17:56
Hello guys.
Im trying to make a /players command that shows the playerid, name and IP, using zcmd.
I did like this:
But it just shows the IP like this: "0.000000000".
Hope you can help. Thank you.
Im trying to make a /players command that shows the playerid, name and IP, using zcmd.
I did like this:
pawn Код:
COMMAND:players(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new name[MAX_PLAYER_NAME], string[28 + MAX_PLAYER_NAME], ip[16];
GetPlayerName(i, name, sizeof(name));
GetPlayerIp(i, ip, sizeof(ip));
format(string, sizeof(string), "(ID:%i) %s (%f)", i, name, ip);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
else return 0;
return 1;
}
Hope you can help. Thank you.