Admin tag
#10

pawn Код:
dcmd_adsetlevel(playerid,params[])
{
    new string[128];
    new ID;
    new cmdreason;
    if(sscanf(params,"ui",ID,cmdreason)) {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adsetlevel (Player Name/ID) (Level)");
        return 1;
    }
    if(!IsPlayerConnected(ID)) {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot set their administrator level.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1) {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you set their administrator level.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(AdminLevel[ID] == cmdreason) {
        format(string,sizeof(string),"%s(%d) is already at the Administrator level: %d",PlayerName(ID),ID,cmdreason);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(playerid == ID) {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot set your own Administrator level. You are already the highest level.");
        return 1;
    }
    format(string,sizeof(string),"[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
    SendClientMessageToAll(COLOR_ADMIN,string);
   
    SendClientMessage(ID,COLOR_ADMIN,"Your admin level has been changed by the Server Owner. To see your new commands type /adcmds.");
    AdminLevel[ID] =cmdreason;
   
    new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME];
    GetPlayerName(ID, oldname, sizeof oldname);
    format(newname, sizeof newname, "[ZL]%s", oldname);
    SetPlayerName(ID, newname);

    format(string,sizeof(string),"9[ADMIN LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
Reply


Messages In This Thread
Admin tag - by zacklogan - 01.09.2012, 01:10
Re: Admin tag - by zacklogan - 24.09.2012, 21:18
Re: Admin tag - by zacklogan - 14.12.2012, 22:45
Re: Admin tag - by Mean - 14.12.2012, 23:30
Re: Admin tag - by zacklogan - 15.12.2012, 00:41
Re: Admin tag - by Horrible - 15.12.2012, 01:32
Re: Admin tag - by maramizo - 15.12.2012, 01:58
Re: Admin tag - by Mean - 15.12.2012, 10:43
Re: Admin tag - by zacklogan - 15.12.2012, 14:52
Re: Admin tag - by Mean - 15.12.2012, 15:26

Forum Jump:


Users browsing this thread: 3 Guest(s)