Set a player's admin level in game.
#2

The most simple way:

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

If you have any questions, ask.
Reply


Messages In This Thread
Set a player's admin level in game. - by Sebz - 11.12.2015, 09:34
Re: Set a player's admin level in game. - by thefirestate - 11.12.2015, 11:25
Re: Set a player's admin level in game. - by Sjn - 11.12.2015, 11:44
Re: Set a player's admin level in game. - by xTURBOx - 11.12.2015, 12:06
Re: Set a player's admin level in game. - by Sebz - 11.12.2015, 12:09

Forum Jump:


Users browsing this thread: 1 Guest(s)