24.06.2013, 07:31
must work dude
Код:
CMD:setlevel(playerid, params[]) { new targetid, level, string[100]; if(pInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_RED, "[ERROR] You are not authorised to use this command"); if(sscanf(params, "ud", targetid, level)) return SCM(playerid, COLOR_RED, "[USAGE] /setlevel <playerid/part of name> <level>"); if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected"); if(level < 1 || level > 5) return SCM(playerid, COLOR_RED, "The range of levels is 1 - 5"); else { pInfo[targetid][pAdmin] = level; format(string, sizeof(string), "Admin %s has set your admin level to %d", GetName(playerid), level); SCM(targetid, COLOR_GREEN, string); format(string, sizeof(string), "You have successfully set %s's level to %d", GetName(targetid), level); SCM(playerid, COLOR_GREEN, string); } return 1; }