Makeadmin with security cod
#3

PHP код:
CMD:makeadmin(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 7
        return 
SendClientMessage(playeridCOLOR_BLUE"You don't have acces to that command."); 
    new 
idstring[128], level
    if(
sscanf(params"dd"idlevel)) 
        return 
SendClientMessage(playeridCOLOR_RED"SERVER: /makeadmin [ID] [LEVEL]"); 
        
    
//ShowPlayerDialog(id,DIALOG_ADMINBOX,DIALOG_STYLE_MSGBOX, "You are an admin", string, "Ok", ""); 
    
format(stringsizeof(string), "%s promoted you to level %i."PlayerName(playerid), level); 
    
SendClientMessage(idCOLOR_BLUEstring); 
    
PlayerInfo[id][pAdmin] = level
    return 
1
}
PlayerName(playerid)
{
    new 
name[21];
    
GetPlayerName(playeridnamesizeof(name));
    return 
name;

As for the "Security code" it's best off to generate a random code (bout 5 characters max), and save it to their file/database and have them use it in a command in order to use any admin commands.
Reply


Messages In This Thread
Makeadmin with security cod [ solved] - by Deny1 - 26.01.2016, 22:54
Re: Makeadmin with security cod - by Mikeydoo - 26.01.2016, 23:17
Re: Makeadmin with security cod - by itsCody - 26.01.2016, 23:30
Re: Makeadmin with security cod - by TwinkiDaBoss - 27.01.2016, 00:34
Re: Makeadmin with security cod - by itsCody - 27.01.2016, 01:02
Re: Makeadmin with security cod - by Deny1 - 27.01.2016, 15:29
Re: Makeadmin with security cod - by Deny1 - 27.01.2016, 15:42
Re: Makeadmin with security cod - by Deny1 - 27.01.2016, 17:16

Forum Jump:


Users browsing this thread: 1 Guest(s)