Everyone is an Admin Level 5 when they connect.
#1

Im using Y_INI to save the player stats (Info).
OnPlayerConnect
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
// The rest is dialogs , the other stats load normally , only the admin level is 5
dialog response
pawn Код:
for register:
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Username",MAX_PLAYER_NAME);
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteString(File, "Ip", IP);
                INI_WriteInt(File,"Score",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Banned",0);
                INI_WriteInt(File,"BannedBy",0);
                INI_WriteInt(File,"BannedName",0);
                INI_WriteInt(File,"BannedFor",0);
                INI_Close(File);
Whats the problem?
Reply
#2

Check if you're applying the admin level anywhere in your script.
Reply
#3

Show your /makeadmin command.
Reply
#4

It's probably because you are not resetting the variables.
Reply
#5

hey dude here is Solution I m sure it will help !!
PHP код:
switch( dialogid )
    {
        case 
DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                
Player[playerid][pAdmin] = 0// add this Line 
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Username",MAX_PLAYER_NAME);
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteString(File"Ip"IP);
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Banned",0);
                
INI_WriteInt(File,"BannedBy",0);
                
INI_WriteInt(File,"BannedName",0);
                
INI_WriteInt(File,"BannedFor",0);
                
INI_Close(File); 
Reply
#6

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Show your /makeadmin command.
Erm, you need to learn to read: "Everyone is an Admin Level 5 when they connect."

Quote:
Originally Posted by Stinged
Посмотреть сообщение
It's probably because you are not resetting the variables.
This is registering. Their account isn't created yet, so what's there to reset?
Reply
#7

he say every player which connect get admin level when every new player join he need to register so all admin level to Zero ,No budy can get that Only Rcon admin can give level .
Reply
#8

The variable are linked to the playerid.

Let me give an example:
Let's say there was an admin level 5 with id 0 online, and that player left.
The admin variable that is linked to id 0 is still 5.
The next player to join and get id 0 will get the admin level that was linked to id 0, which is 5.

Just try to reset it under OnPlayerDisconnect, and tell me what happens.
Reply
#9

Quote:
Originally Posted by Stinged
Посмотреть сообщение
The variable are linked to the playerid.

Let me give an example:
Let's say there was an admin level 5 with id 0 online, and that player left.
The admin variable that is linked to id 0 is still 5.
The next player to join and get id 0 will get the admin level that was linked to id 0, which is 5.

Just try to reset it under OnPlayerDisconnect, and tell me what happens.
Like Stinged said,
You should try to reset it under OnPlayerConnect or OnPlayerDisconnect Callback except the Password, Like for Example :-
pawn Код:
// Under OnPlayerConnect Callback
    pInfo[playerid][pAdmin] = 0;
    pInfo[playerid][Score] = 0;
    pInfo[playerid][Money] = 0;
    pInfo[playerid][Kills] = 0;
    pInfo[playerid][Deaths] = 0;

// Blah... Blah... Blah... The Rest of the Codes here.
// The stats/values/integers that have been saved will be loaded using the function called INI_ParseFile...
// You can set it inside the OnPlayerDisconnect Callback too...
Reply
#10

Quote:
Originally Posted by SAMProductions
Посмотреть сообщение
Like Stinged said,
You should try to reset it under OnPlayerConnect or OnPlayerDisconnect Callback except the Password, Like for Example :-
pawn Код:
// Under OnPlayerConnect Callback
    pInfo[playerid][pAdmin] = 0;
    pInfo[playerid][Score] = 0;
    pInfo[playerid][Money] = 0;
    pInfo[playerid][Kills] = 0;
    pInfo[playerid][Deaths] = 0;

// Blah... Blah... Blah... The Rest of the Codes here.
// The stats/values/integers that have been saved will be loaded using the function called INI_ParseFile...
// You can set it inside the OnPlayerDisconnect Callback too...
First putting this Under OnPlayerConnect and OnPlayerDisconnect Like this Not Help it make problem When you make your self admin in game And relog then on player COnnect it will set Your Level to Zero Same Problem On Player Disconnect
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)