26.03.2014, 00:17
pawn Код:
CMD:setadmin(playerid, params[])
{
new id, level;
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "USAGE: /setadmin [id] [level]");
if(PlayerInfo[playerid][AdminLevel] == 10) // only example
{
if(IsPlayerConnected(id))
{
if(1 <= level < 10) // only example
{
new string[128];
PlayerInfo[id][AdminLevel] = level;
format(string, sizeof(string), "* %s have promoted you to admin level %d.", level);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "* You have promoted %s to admin level %d.", level);
SendClientMessage(playerid, -1, string);
}
else SendClientMessage(playerid, -1, "ERROR: Invalid level (valid level: 1 - 10.");
}
else SendClientMessage(playerid, -1, "ERROR: Player not connected!");
}
else SendClientMessage(playerid, -1, "ERROR: You are not admin!");
}