[HELP] Makeadmin
#2

pawn Код:
CMD:makeadmin(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] >= 7)
    {
        new string[128],name[MAX_PLAYER_NAME],pID,Level;
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        if(sscanf(params,"ui",pID,Level)) return SendClientMessage(playerid,COLOR_GREY,"/makeadmin <player> <level>");
        if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,COLOR_GREY,"ERROR: Player not connected!");
        if(PlayerInfo[pID][pAdminLevel] != Level)
        {
            if(PlayerInfo[pID][pAdminLevel] < Level)
            {
                  PlayerInfo[pID][pAdminLevel] = Level;
                  format(string,sizeof(string),"** ADMIN PROMOTE: %s Is Now An Administrator Level %d!",name,Level);
                  SendClientMessageToAll(COLOR_PINK,string);
                  GameTextForPlayer(pID,"~g~Promoted",3000,4);
            }
            else
            {
                GameTextForPlayer(pID,"~r~Demoted",3000,4);
                format(string,sizeof(string),"** ADMIN DEMOTE: %s Has Been Demoted To Level %d!",name,Level);
                SendClientMessageToAll(COLOR_PINK,string);
                PlayerInfo[pID][pAdminLevel] = Level;
            }
        }
            else return SendClientMessage(playerid, COLOR_RED, "This player is already that level.");
    }
    else return 0;
    return 1;
}
Reply


Messages In This Thread
[HELP] Makeadmin - by xMichaelx - 09.12.2011, 01:21
Re: [HELP] Makeadmin - by [MWR]Blood - 09.12.2011, 08:17
Re: [HELP] Makeadmin - by xMichaelx - 09.12.2011, 08:25
Re: [HELP] Makeadmin - by KingHual - 09.12.2011, 08:35
Re: [HELP] Makeadmin - by xMichaelx - 09.12.2011, 08:40
Re: [HELP] Makeadmin - by KingHual - 09.12.2011, 08:46
Re: [HELP] Makeadmin - by T0pAz - 09.12.2011, 08:48

Forum Jump:


Users browsing this thread: 3 Guest(s)