Modifying My /makeadmin command
#9

pawn Code:
CMD:makeadmin(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
    if(PlayerInfo[playerid][pAdmin] >= 10 || IsPlayerAdmin(playerid))
    {
        if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setadmin <playerid/name> <level>");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ID");
        if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: Available Admin Levels: 1-10!");
        if(PlayerInfo[id][pAdmin] == admlvl) return SendClientMessage(playerid,COLOR_RED,"ERROR: This player is already this level!");
        if(PlayerInfo[id][pAdmin] > admlvl) return GameTextForPlayer(id,"~g~~h~Promoted!",4000,3);
        if(PlayerInfo[id][pAdmin] < admlvl) return GameTextForPlayer(id,"~r~~h~Demoted!",4000,3);
        PlayerInfo[id][pAdmin] = admlvl;
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"Administrator %s has set %s Admin Level to %i",adminname,victimname,admlvl);
        SendClientMessage(playerid,COLOR_GREEN,str);
        format(str, sizeof(str), "Administrator %s has made %s to Admin Level %i",adminname,victimname,admlvl);
        SendToAdmins(COLOR_GREY,str);
        format(str, sizeof(str), "Administrator %s has made %s to Admin Level %i",adminname,victimname,admlvl);
        printf(str);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You");
    return 1;
}
Reply


Messages In This Thread
Modifying My /makeadmin command - by GAMER_PS2 - 20.10.2011, 09:36
Re: Modifying My /makeadmin command - by iJumbo - 20.10.2011, 09:45
Re: Modifying My /makeadmin command - by nilanjay - 20.10.2011, 09:46
Re: Modifying My /makeadmin command - by iJumbo - 20.10.2011, 09:47
Re: Modifying My /makeadmin command - by GAMER_PS2 - 20.10.2011, 09:48
Re: Modifying My /makeadmin command - by nilanjay - 20.10.2011, 09:50
Re: Modifying My /makeadmin command - by GAMER_PS2 - 20.10.2011, 10:04
Re: Modifying My /makeadmin command - by nilanjay - 20.10.2011, 10:27
Re: Modifying My /makeadmin command - by [MWR]Blood - 20.10.2011, 10:29
Re: Modifying My /makeadmin command - by iJumbo - 20.10.2011, 10:31

Forum Jump:


Users browsing this thread: 3 Guest(s)