07.06.2013, 19:17
pawn Код:
CMD:makeadmin(playerid, params[])
{
new targetid, admin, string[128];
if(pInfo[playerid][AdminLevel] < 1337) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to use this command.");
if(sscanf(params, "ud", targetid, admin)) return SendClientMessage(playerid, COLOR_WHITE,"Usage: /makeadmin [PlayerID][AdminLevel]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: That player is not in the server");
if(pInfo[playerid][AdminLevel] < PlayerInfo[targetid][pAdmin]) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You cant demote/promote a higher level admin.");
if(pInfo[playerid][AdminLevel] < admin) return SendClientMessage(playerid, COLOR_WHITE,"ERROR: You can't promote yourself");
pInfo[targetid][AdminLevel] = admin;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have made someone admin!");
SendClientMessage(targetid, COLOR_LIGHTBLUE, "You have been made admin!");
return 1;
}