11.12.2015, 11:25
The most simple way:
If you have any questions, ask.
PHP код:
CMD:makeadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid) || pInfo[playerid][Adminlevel] == 5) // I am asuming you have 5 different admin levels, not sure how exactly you have.
{
new toid, level;
if(!sscanf(params, "ui", toid, level))
{
pInfo[toid][Adminlevel] = level;
new string[50];
format(string, sizeof(string), "You have been set as level %d administrator.", level);
SendClientMessage(toid, -1, string);
new name[25];
GetPlayerName(toid, name, sizeof(name));
format(string, sizeof(string), "You have set %s's admin level to %d.", name, level);
}
else return SendClientMessage(playerid, -1, "USAGE: /makeadmin [playerid/partofname] [level]");
}
else return SendClientMessage(playerid, -1, "Access denied.");
}