Server Administrator Problem
#1

Hey guys!

I have this problem, everything on my server works fine, however, when I make one of the players administrators, then all the players who register after that are administrators aswell :/

Anyone know how to solve it ?

If you need any part of the code, just ask.

Thank you!
Reply
#2

Quote:
Originally Posted by Jigsaw123
Посмотреть сообщение
Hey guys!

I have this problem, everything on my server works fine, however, when I make one of the players administrators, then all the players who register after that are administrators aswell :/

Anyone know how to solve it ?

If you need any part of the code, just ask.

Thank you!
To help you need to put a code snippet
Reply
#3

If you are using a MySQL query either you forgot to specify a WHERE column or the string size for the query string isn't big enough & is cutting it off.

If you aren't using a query, show the code you are using for setting administrators.
Reply
#4

Quote:

CMD:makeadmin(playerid, params[])
{
new targetid, level;
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", targetid, level)) return SCM(playerid, COLOR_WHITE,"{E5AC00}Usage: {FFFFFF}/makeadmin [ID] [Level 1-6]");
else if(targetid == INVALID_PLAYER_ID) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
else
{
format(string, sizeof(string),"{37A63D}(INFO){FFFFFF}You made %s Admin level %i!", PlayerName(targetid), level);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string),"{37A63D}(INFO){FFFFFF}You have been promoted to Level %i Admin by Executive Adminstrator %s ", level, PlayerName(playerid));
SCM(targetid, COLOR_WHITE, string);
PlayerInfo[targetid][pAdmin] = level;
format(string, sizeof(string),"{37A63D}(INFO){FFFFFF}Executive Adminstrator %s promoted %s to Admin Level %i | ",PlayerName(playerid),PlayerName(targetid),level) ;
AdminMessage(COLOR_WHITE, string);
SavePlayer(targetid);
}
return 1;
}

This is the code to make an administrator :P
Reply
#5

Quote:
Originally Posted by Jigsaw123
Посмотреть сообщение
This is the code to make an administrator :P
You might want to post the SavePlayer function
Reply
#6

Quote:
Originally Posted by Jigsaw123
Посмотреть сообщение
This is the code to make an administrator :P
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;

Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)