Server Administrator Problem
#7

Quote:
Originally Posted by Logofero
Посмотреть сообщение
PHP код:
CMD:makeadmin(playeridparams[])
{
    new 
targetidlevel;
    new 
string[128];
    if(
PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid,COLOR_RED,"{AF1C1C}(INFO):{FFFFFF}Onl y Executive Administators can use this command. ");
    else if (
sscanf(params"ui"targetidlevel)) return SCM(playeridCOLOR_WHITE,"{E5AC00}Usage: {FFFFFF}/makeadmin [ID] [Level 1-6]");
    else if(
targetid == INVALID_PLAYER_ID) return SCM(playeridCOLOR_RED"{B3B3B3}Player is not online");
    else
    {
        
format(stringsizeof(string),"{37A63D}(INFO){FFFFFF}You made %s Admin level %i!"PlayerName(targetid), level);
        
SCM(playeridCOLOR_WHITEstring);
        
format(stringsizeof(string),"{37A63D}(INFO){FFFFFF}You have been promoted to Level %i Admin by Executive Adminstrator %s "levelPlayerName(playerid));
        
SCM(targetidCOLOR_WHITEstring);
        
PlayerInfo[targetid][pAdmin] = level;
        
format(stringsizeof(string),"{37A63D}(INFO){FFFFFF}Executive Adminstrator %s promoted %s to Admin Level %i | ",PlayerName(playerid),PlayerName(targetid),level) ;
        
AdminMessage(COLOR_WHITEstring);
        
SavePlayer(targetid);
    }
    return 
1;

public 
OnPlayerDisconnect(playeridreason
{
    
// You forgot to reset the level when a player is disconnected from the server. On this when someone enters a given ID it receives administrator rights.
    
PlayerInfo[playerid][pAdmin] = 0// Reset level for player ID
    
return 1;

This will also sets admin's level to 0 and admin level wont save, please post your saving code
Reply


Messages In This Thread
Server Administrator Problem - by Jigsaw123 - 23.08.2015, 14:57
Re: Server Administrator Problem - by Logofero - 23.08.2015, 15:20
Re: Server Administrator Problem - by Abagail - 23.08.2015, 15:32
Re: Server Administrator Problem - by Jigsaw123 - 23.08.2015, 16:54
Re: Server Administrator Problem - by MartinSwag - 23.08.2015, 16:58
Re: Server Administrator Problem - by Logofero - 24.08.2015, 16:25
Re: Server Administrator Problem - by SecretBoss - 24.08.2015, 16:49

Forum Jump:


Users browsing this thread: 1 Guest(s)