19.12.2015, 15:48
easy exp of this in command
Код:
CMD:setlevel(playerid, params[]) { new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id; if(PlayerInfo[playerid][pAdmin] >=7 || IsPlayerAdmin(playerid)) { if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setlevel [id] [adminlevel]"); if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[ERROR]:Invalid ID"); if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid Admin Levels: 1-10!"); PlayerInfo[id][pAdmin] = admlvl; GetPlayerName(id, victimname, sizeof(victimname)); GetPlayerName(playerid, adminname, sizeof(adminname)); new str[128]; format(str,128,"Admin %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl); SendClientMessage(playerid,COLOR_BLUE,str); return 1; } else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!"); }