How do i create a /playerlist?
#1

Ok so im trying to create a /playerlist that show all players online and their level in this format:

playername (VirtualWorld) (Level)
playername (VirtualWorld) (Level)
playername (VirtualWorld) (Level)
.. and so on for each player.

I can get the player his name but i dont know how to get all players name and info.Could somebody help me out with this please?
Reply
#2

pawn Код:
CMD:playerlist(playerid, params[])
{
    new VW, Score, name[MAX_PLAYER_NAME], string[1024];
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(playerid))
        {
            VW = GetPlayerVirtualWorld(i);
            Score = GetPlayerScore(i);
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s | %d | %d", name, VW, Score);
            SendClientMessage(playerid, -1, string);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)