/setadmin command help
#7

Not tested.
edit: I think you might actually be able to do this:
pawn Код:
CMD:setadmin(playerid, params[])
{
    new id, adminlevel,MyRank[32],HisRank[32],MyName[32],HisName[32];
    if(PlayerInfo[playerid][pAdmin] <= 4) return SendClientMessage(playerid, COLOR_SILVER, "You must be atleast a Community Owner to use this command!");
    else if(sscanf(params, "ud", id, adminlevel)) return SendClientMessage(playerid, COLOR_SILVER, "Syntax: /setadmin [PlayerID][Admin Level]");
    else if(adminlevel < 0 || adminlevel > 5) return SendClientMessage(playerid, COLOR_SILVER, "Error: Must be level 1-5!");
    else
    {
        if(PlayerInfo[id][pAdmin] == adminlevel) return SendClientMessage(playerid, COLOR_SILVER, "Error: This player is already that level!");
        else
        {
            GetPlayerName(playerid,MyName,32);
            GetPlayerName(id,HisName,32);
            PlayerInfo[id][pAdmin] = adminlevel;
            if(PlayerInfo[playerid][pAdmin] == 1){MyRank = "Moderator";}
            if(PlayerInfo[playerid][pAdmin] == 2){MyRank = "Trial Administrator";}
            if(PlayerInfo[playerid][pAdmin] == 3){MyRank = "Administrator";}
            if(PlayerInfo[playerid][pAdmin] == 4){MyRank = "Lead Administrator";}
            if(PlayerInfo[playerid][pAdmin] == 5){MyRank = "Community Owner";}
            if(adminlevel == 3)
           {  
                  new string[128];
                  format(string, sizeof(string), "[AdmCmd] %s %s(ID:%d) had made %s(ID:%d) an                                 Administrator",MyRank,MyName,playerid,HisName,id);
                   SendClientMessageToAll(COLOR_YELLOW,string);
          }

        }
    }
    return 1;
}
Reply


Messages In This Thread
/setadmin command help - by Anjh - 05.04.2013, 17:30
Re: /setadmin command help - by Shockey HD - 05.04.2013, 18:31
Re: /setadmin command help - by Anjh - 05.04.2013, 18:46
Re: /setadmin command help - by nor15 - 05.04.2013, 18:51
Re: /setadmin command help - by Shockey HD - 05.04.2013, 18:51
Re: /setadmin command help - by Anjh - 05.04.2013, 18:59
Re: /setadmin command help - by BigGroter - 05.04.2013, 20:34

Forum Jump:


Users browsing this thread: 2 Guest(s)