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

pawn Код:
CMD:setadmin(playerid, params[])
{
    new id, level, string[128];
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(!sscanf(params,"ui", id, level))
        {
            if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID)
            {
                if(level >= 0 && level <= 5)
                {
                    if(PlayerInfo[playerid][pAdmin] > PlayerInfo[id][pAdmin])
                    {
                        if(level != PlayerInfo[id][pAdmin])
                        {
                            format(string, sizeof(string),"Admin %s have set your admin rank to level %d.", GetName(playerid), level);
                            SendClientMessage(id, COLOR_RED, string);
                           
                            format(string ,sizeof(string),"[Name: %s | Old Rank: %d | New Rank: %d]", GetName(id), PlayerInfo[id][pAdmin], level);
                            SendClientMessage(playerid, COLOR_RED, string);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE,"Rank "GREEN"Succesfully "LIGHTBLUE"updated(Changed).");
                           
                            PlayerInfo[id][pAdmin] = level;
                        }
                        else SendClientMessage(playerid, ERROR,"The player is already that level administrator.");
                     }
                     else SendClientMessage(playerid, ERROR,"You cannot promote/demote a higher level admin than you.");
                }
                else SendClientMessage(playerid, ERROR,"Levels are only from 0 - 5");
            }
            else SendClientMessage(playerid, ERROR,"Invalid Player.");
        }
        else SendClientMessage(playerid, ERROR,"Usage: /setadmin [playerid] [level]");
    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}
This is the Code and it only works on the ID 0

And i want to add this thing in this that if a player increases the level then it should say Promoted and if level < and then it says Demoted.
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: 1 Guest(s)