24.02.2012, 06:12
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
new id;
new AdminLevel2;
if(!sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
if(IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");
new string[126];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), ""red"[DU]:"green"Server Owner %s Has Set Your Level To %d", name, AdminLevel2);
SendClientMessage(id, COLOR_GREEN, string);
format(string, sizeof(string), "You Gave Admin Level %d To %s", AdminLevel2, PlayerName);
SendClientMessage(playerid, COLOR_GREEN, string);
PlayerInfo[id][AdminLevel] = AdminLevel2;
return 1;
}