Need help with IRC command
#1

Hello, I have this code in my irc script:
pawn Код:
IRCCMD:players(botid, channel[], user[], host[], params[])
{
    if(IRC_IsHalfop(botid, channel, user))
    {
        for(new i=0; i<GetMaxPlayers(); i++)
        {
            if(IsPlayerConnected(i))
            {
                new msg[128], name[24], ip[16];
                GetPlayerName(i, name, 24);
                GetPlayerIp(i, ip, 16);
                format(msg, sizeof(msg), "[%d] %s (%s)", i, name, ip);
                IRC_GroupSay(gGroupID, channel, msg);
            }
        }
    }
    return 1;
}
And in IRC it shows like this:
pawn Код:
<Bot1> [1] [NWA]Hannes (127.0.0.1)
<Bot2> [0] Michael (127.0.0.1) //This is a NPC i have.
But how can i change the order so it shows like this instead?
pawn Код:
<Bot1> [0] Michael (127.0.0.1) //This is a NPC i have.
<Bot2> [1] [NWA]Hannes (127.0.0.1)
So it gets ordered by the player id.

Thanks in advance, ~Hannes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)