Set admin
#2

pawn Код:
CMD:rmakeadmin(playerid, params[]) // CMD for making someone an admin...
{
    new pid;
    new alevel;
    new str[128];
    if(sscanf(params,"ui", pid, alevel)) return SendClientMessage(playerid, -1, "USAGE: /rmakeadmin [playerid] [admin level]");
    if (IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "  You are not authorized to use this command !");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified !");
    if((alevel<=5)&&(alevel>=1)) return SendClientMessage(playerid, COLOR_GREY, "  Invalid admin level specified (Admin Level 1-5)");
    {
        format(str, sizeof(str), "* You have promoted player %s to a level %i admin.", GetName(pid), alevel);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
        format(str, sizeof(str), "* You have been promoted to a level %i admin by a Administrator.", alevel);
        SendClientMessage(pid, COLOR_LIGHTBLUE, str);
        PlayerInfo[pid][pAdmin] = alevel;
    }
    return 1;
}
Reply


Messages In This Thread
Set admin - by JustinAn - 27.07.2012, 20:37
Re: Set admin - by rVar - 27.07.2012, 20:43
Re: Set admin - by JustinAn - 27.07.2012, 20:47
Re: Set admin - by JustinAn - 27.07.2012, 20:57
Re: Set admin - by Marlon_Lorran - 27.07.2012, 21:01
Re: Set admin - by JustinAn - 27.07.2012, 21:12

Forum Jump:


Users browsing this thread: 1 Guest(s)