08.08.2013, 05:00
This might not be the best explained command but hey ho.
pawn Код:
CMD:makeadmin(playerid, params[]) // /makeadmin command
{
if(PlayerInfo[playerid][pAdmin] >= 5) // Checking if their admin level is equal to or above 5.
{
new id, string[128], level; // defines.
if(sscanf(params, "dd", id, level)) return SendClientMessage(playerid, COLOR_RED, "(INFO): /makeadmin [id] [level]"); // if they type '/makeadmin' it'll show the correct parameters.
format(string, sizeof(string), "You've been promoted to a level %d Administrator.", level); // Confirming they've given their chosen ID the admin level they wanted to give.
SendClientMessage(id, COLOR_LIGHTBLUE, string); // Sends the message to the one being promoted.
PlayerInfo[id][pAdmin] = level; // Sets their Admin level.
}
else return SendClientMessage(playerid, COLOR_RED, "You don't have access to this command."); // If they're not equal to or above 5, tell them they can't use the command.
return 1;
}