Command: /makeadmin help
#5

Using ZCMD - sscanf :

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new id,
        level;
       
    if(gPlayerInfo[playerid][PLAYER_LEVEL] < 5)
        return SendClientMessage(playerid, -1, "You need to be Level 10 to use this command!");
       
    if(sscanf(params, "ui", id, level))
        return SendClientMessage(playerid, -1, "Usage: /makeadmin <playerid> <level>");
       
    if(id == playerid)
        return SendClientMessage(playerid, -1, "ERROR:{00CED1} You cannot set your own Admin Level!");
       
    if(!IsPlayerConnected(id))
        return SendClientMessage(playerid, -1, "ERROR:{00CED1} Player is not connected!");

    if ( level < 0 || level > 5 )
        return SendClientMessage(playerid, -1, "ERROR:{00CED1} Invalid Admin level");
       
    gPlayerInfo[id][PLAYER_LEVEL] = level;
    new pName[MAX_PLAYER_NAME], str[128], pName1[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(id, pName1, sizeof(pName1));
    format(str, sizeof(str), "Administrator %s has changed %s's Admin level to %i",pName, pName1, level);
    SendClientMessageToAll(-1, str);
    return 1;
}
Should work
Reply


Messages In This Thread
Command: /makeadmin help - by Areax - 04.04.2013, 12:40
Re: Command: /makeadmin help - by Konstantinos - 04.04.2013, 12:45
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:45
Re: Command: /makeadmin help - by Areax - 04.04.2013, 12:46
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:49
Re: Command: /makeadmin help - by Areax - 04.04.2013, 12:51
Re: Command: /makeadmin help - by DaRk_RaiN - 04.04.2013, 12:51
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:56
Re: Command: /makeadmin help - by DaRk_RaiN - 04.04.2013, 13:01
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 13:03

Forum Jump:


Users browsing this thread: 1 Guest(s)