[CMD] /Setadmin just works on ID 0 [Rep+]
#3

Please check this is my code and nicely indented but still that problem that it just works on ID 0


pawn Код:
CMD:rsetadmin(playerid, params[])
{
    new id, level, string[128];
    if(IsPlayerAdmin(playerid))
    {
        if(!sscanf(params,"ui", id, level))
        {
            if(level < 6 && level >= 0)
            {
                if(IsPlayerConnected(id))
                {
                    if(PlayerInfo[id][pAdmin] != level)
                    {
                        if(PlayerInfo[id][pAdmin] < level)
                            {
                                PlayerInfo[id][pAdmin] = level;
                                format(string, sizeof(string),"RCON Admin %s have promoted you to admin level %i.",GetName(playerid), level);
                                SendClientMessage(id, COLOR_RED, string);

                                format(string, sizeof(string),"You have promoted %s to admin level %i.", GetName(id), level);
                                SendClientMessage(playerid, COLOR_RED, string);
                            }
                            else
                            {
                                PlayerInfo[id][pAdmin] = level;
                                format(string, sizeof(string),"RCON Admin %s have demoted you to admin level %i.",GetName(playerid), level);
                                SendClientMessage(id, COLOR_RED, string);

                                format(string, sizeof(string),"You have demoted %s to admin level %i.",GetName(id), level);
                                SendClientMessage(playerid, COLOR_RED, string);
                            }
                    }
                    else SendClientMessage(playerid, ERROR,"The player is already that level admin.");
                }
                else SendClientMessage(playerid, ERROR,"Invalid Player.");
            }
            else SendClientMessage(playerid, ERROR,"Levels only from 0 - 5.");
        }
        else SendClientMessage(playerid, ERROR,"Usage: /rsetadmin [playerid] [Level]");
    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}
Reply


Messages In This Thread
[CMD] /Setadmin just works on ID 0 [Rep+] - by Spooky - 29.12.2011, 05:43
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by §с†¶e®РµРe - 29.12.2011, 05:56
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by Spooky - 29.12.2011, 06:24
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by robintjeh - 29.12.2011, 06:41
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by Spooky - 29.12.2011, 06:42
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by iChronic - 29.12.2011, 07:12
Re: [CMD] /Setadmin just works on ID 0 [Rep+] - by Spooky - 29.12.2011, 07:27

Forum Jump:


Users browsing this thread: 2 Guest(s)