/makeadmin - Command
#3

PHP код:
CMD:makeadmin(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
string[MAX_PLAYER_NAME+250],
             
pname[MAX_PLAYER_NAME],
             
tname[MAX_PLAYER_NAME],
             
targetid,
             
level;
        if(
sscanf(params"ii"targetidlevel))
        {
            return 
SendClientMessage(playerid0xF8F8F8FFF"Syntax: {F00f00}/makeadmin [id] [level]");
        }
        for(new 
i=0;i<MAX_PLAYERSi++) continue; {
                 if((!
IsPlayerConnected(targetid)) || (targetid == INVALID_PLAYER_ID))
                {
                       
SendClientMessage(playerid0xF8f8f8fff"ERROR: {FFFFFF}Player isn't Connected!");
                }
    }
        if(
level || level 6)
        {
            return 
SendClientMessageplayerid0xF8F8F8FFF"ERROR: {FFFFFF}highest Level is 6.");
        }
        else
        {
            
GetPlayerName(playeridpnamesizeof(pname));
            
GetPlayerName(targetidtnamesizeof(tname));
            
format(stringsizeof(string), "{FFFF00}- {ff0000}Adm{00ffff}CMD{FFFF00} - {FFD700}%s {15ff00}has set {FFD700}%s {15ff00}Administrator's Level to {FFD700}%i{15ff00}."pnametnamelevel);
            
SendClientMessageToAll(0xF8F8F8FFFstring);
            new 
INI:File INI_Open(UserPath(targetid));
            
PlayerInfo[targetid][pAdmin] = level;
            
INI_WriteInt(File,"Admin",level);
               
INI_Close(File);
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playerid0xf8F8F8FFF,"ERROR: {FFFFFF}You aren't authorized to use this command!");
    }
    return 
1;

Edit somethings to become related to your Administration System.
Reply


Messages In This Thread
/makeadmin - Command - by Celmir - 17.02.2017, 16:03
Re: /makeadmin - Command - by Ultraz - 17.02.2017, 16:35
Re: /makeadmin - Command - by RyderX - 17.02.2017, 17:00
Re: /makeadmin - Command - by BlackbirdXd - 17.02.2017, 17:02
Re: /makeadmin - Command - by Celmir - 17.02.2017, 17:56

Forum Jump:


Users browsing this thread: 3 Guest(s)