24.05.2015, 15:05
Код:
CMD:setlevel(playerid, params[]) { new level, id; if(sscanf(params, "rd", id, level)) return SendClientMessage(playerid, RED, "[USAGE]: /setlevel [name/id] [level]"); if(!IsPlayerConnected(id) ) return SendClientMessage(playerid, RED, "Player not found."); if(IsLoggedIn{id} == 0) return SendClientMessage(playerid, RED, "Player not logged in."); if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][aLevel] == 4) { PlayerInfo[id][aLevel] = level; PlayerPlaySound(id,1085,0.0,0.0,0.0); format(fstr, sizeof(fstr), "You have set %s [%d] admin level to %d.", GetName(id), id, level); SendClientMessage(playerid, YELLOW, fstr); format(fstr, sizeof(fstr), "Admin %s [%d] has set your admin level to %d.", GetName(playerid), playerid, level); SendClientMessage(id, LIGHTGREEN, fstr); SaveUserStats(id); } else { SendClientMessage(playerid, RED, "Only admin level 4 can use this command."); } return true; }