Need help with admin view.
#6

You're using the "else" two times.
pawn Код:
// An example
new
    x = 1,
    y = 2
;

if( x > y )
{  
    y = x;
}
else
{  
    y = x;
}
// It should stop here, although you're using another else which is wrong.
else
{  
    y = x;
}
I'm not sure what exactly did you want to do there, but I think you wanted to continue outside the if/else statement.
pawn Код:
CMD:team(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_GREY, "{4985d7}[Admin Team] {a7c2e6}- Administrators:");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 6)
                {
                    new adminfo[64], sendername[MAX_PLAYER_NAME], string[128];
                    if(PlayerInfo[i][pAdmin] == 5) { adminfo = "Owner"; }
                    else if(PlayerInfo[i][pAdmin] == 4) { adminfo = "Head Of Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 3) { adminfo = "Lead Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 2) { adminfo = "Basic Admin"; }
                    else if(PlayerInfo[i][pAdmin] == 1) { adminfo = "Trial Admin"; }
                    else { adminfo = "Admin"; }
                    GetPlayerName(i, sendername, sizeof(sendername));
                    if(AdminDuty[i] == 0)
                    {
                        format(string, 128, "{e1e3e6} - %s %s", adminfo, sendername);
                        SendClientMessage(playerid, random(0xFFFFFFFF), string);
                    }
                    else
                    {
                        format(string, 128, "{7bd25c} - %s %s [ADMIN DUTY]", adminfo, sendername);
                        SendClientMessage(playerid, 0xFAAFBEFF, string);
                    }
                    SendClientMessage(playerid, COLOR_GREY, "{4985d7}[Helper Team] {a7c2e6}- Helpers:");
                    for(i = 0; i < MAX_PLAYERS; i++)
                    {
                        if(IsPlayerConnected(i))
                        {
                            if(PlayerInfo[i][pHelper] >= 1 && PlayerInfo[i][pHelper] <= 2)
                            {
                                new helperinfo[64];
                                if(PlayerInfo[i][pHelper] == 1) { helperinfo = "Helper"; }
                                else { helperinfo = "Helper"; }
                                GetPlayerName(i, sendername, sizeof(sendername));
                                if(AdminDuty[i] == 0)
                                {
                                    format(string, 128, "{e1e3e6} - %s %s", helperinfo, sendername);
                                    SendClientMessage(playerid, random(0xFFFFFFFF), string);
                                }
                                else
                                {
                                    format(string, 128, "{7bd25c} - %s %s [HELPER DUTY]", helperinfo, sendername);
                                    SendClientMessage(playerid, 0xFAAFBEFF, string);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Need help with admin view. - by zionx08 - 04.12.2012, 14:03
Re: Need help with admin view. - by Konstantinos - 04.12.2012, 14:08
Re: Need help with admin view. - by zionx08 - 04.12.2012, 14:30
Re: Need help with admin view. - by Konstantinos - 04.12.2012, 14:48
Re: Need help with admin view. - by zionx08 - 04.12.2012, 15:15
Re: Need help with admin view. - by Konstantinos - 04.12.2012, 15:22
Re: Need help with admin view. - by Bicentric - 04.12.2012, 15:28
Re: Need help with admin view. - by zionx08 - 04.12.2012, 15:30
Re: Need help with admin view. - by zionx08 - 04.12.2012, 15:33

Forum Jump:


Users browsing this thread: 1 Guest(s)