Player list command
#1

Hello guys.
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;
}
But it just shows the IP like this: "0.000000000".

Hope you can help. Thank you.
Reply


Messages In This Thread
Player list command - by sim_sima - 10.06.2011, 17:56
Re: Player list command - by Sascha - 10.06.2011, 17:58
Re: Player list command - by sim_sima - 10.06.2011, 17:59
Re: Player list command - by sim_sima - 10.06.2011, 18:04
Re: Player list command - by Sascha - 10.06.2011, 18:06
Re: Player list command - by sim_sima - 10.06.2011, 18:24
Re: Player list command - by Sascha - 10.06.2011, 18:24
Re: Player list command - by sim_sima - 10.06.2011, 21:25

Forum Jump:


Users browsing this thread: 2 Guest(s)