"/admins" command
#1

Hey guys,

I've got this /admins command uh, sometimes it shows who's online and sometimes the server returns "SERVER: Unkown Command" after it gives "====[Online Administrators]====", so I'm going to paste the command here, and please tell me what's wrong?

pawn Код:
CMD:admins(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "====[Online Administrators]====");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 6)
                {
                    new admtext[64], sendername[MAX_PLAYER_NAME], string[128];
                    if(PlayerInfo[i][pAdmin] == 5) { admtext = "Owner"; }
                    else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Head Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Lead Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Basic Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Trial Admin"; }
                    else { admtext = "Trial Admin"; }
                    GetPlayerName(i, sendername, sizeof(sendername));
                    sendername[strfind(sendername,"_")] = ' ';
                    if(AdminDuty[i] == 0)
                    {
                        format(string, 128, "%s: %s (AdminDuty: No)", admtext, sendername);
                        SendClientMessage(playerid, COLOR_RED, string);
                    }
                    else
                    {
                        format(string, 128, "%s: %s (AdminDuty: Yes)", admtext, sendername);
                        SendClientMessage(playerid, COLOR_GREEN, string);
                    }
                }
            }
        }
    }
    return 1;
}
I guess the problem starts from this line:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
        {
Reply


Messages In This Thread
"/admins" command || PICTURE ADDED! - by Guitar - 24.08.2012, 09:27
Re: "/admins" command - by Guitar - 24.08.2012, 09:29
Re: "/admins" command - by DarkB0y - 24.08.2012, 09:59
Re: "/admins" command - by preda98 - 24.08.2012, 10:02
Re: "/admins" command - by Guitar - 24.08.2012, 10:04
Re: "/admins" command - by preda98 - 24.08.2012, 10:06
Re: "/admins" command - by Guitar - 24.08.2012, 10:18

Forum Jump:


Users browsing this thread: 2 Guest(s)