28.10.2018, 13:28
Код:
CMD:makeadmin(playerid, params[]) { new AdminLevel; if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!"); if(PlayerInfo[targetid][pAdmin] >= 3 || IsPlayerAdmin(playerid)) { if(sscanf(params, "ui", targetid, AdminLevel)) return SendClientMessage(playerid, -1, "USAGE: /makeadmin [ID] [LEVEL 1-4]"); if(AdminLevel < 1 || AdminLevel > 4) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Admin level"); SendClientMessageEx(playerid, COLOR_LAWNGREEN, "You've just been made: %s admin level: %i", ReturnName(targetid), AdminLevel); SendClientMessageEx(targetid, COLOR_LAWNGREEN, "You've just been made admin level: %i by %s", AdminLevel, ReturnName(playerid)); PlayerInfo[targetid][pAdmin] = AdminLevel; } else return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an Admin!"); return 1; }
Why?