Why is everybody admin?
#1

Heey guys,
I made my own INI saving system.
I watched on my server and saw that everybody was admin.
Whats wrong with this:
Code:
enum pInfo
{
    pAdmin

}
forward LoadUser_AccountData(playerid,name[],value[]);
public LoadUser_AccountData(playerid,name[],value[])
{
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    return 1;
}
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_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");
                new INI:File = INI_Open(UserPath(playerid));
                new plrIP[16];
                INI_SetTag(File,"AccountData");
                INI_WriteString(File,"Name",name);
		INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Admin",0);
                INI_Close(File);

                DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
			}
        }
Reply
#2

I hope for you that it isn't all your code. ..
Reply
#3

lol no i have more then this:P But i delete the admin and make just a command for being admin:P
Reply
#4

Show the rest.
Reply
#5

Give Details.
Reply
#6

You need to reset the variable pAdmin, for example at OnPlayerConnect. Otherwise every player will have the variable of that player before.

So you were Admin, a other player came, and was also Admin etc...

Example:
pawn Code:
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pAdmin] = 0;
return 1;
}
Reply
#7

Quote:
Originally Posted by Gomma
View Post
You need to reset the variable pAdmin, for example at OnPlayerConnect. Otherwise every player will have the variable of that player before.

So you were Admin, a other player came, and was also Admin etc...

Example:
pawn Code:
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pAdmin] = 0;
return 1;
}
Thats my problem
Reply
#8

Look around abouts OnPlayerConnect, something there is setting the player to Administrator. Show us coding please.
Reply
#9

I just follow this: https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#10

And your registration system is exactly like Kush's version without you editing anything yes?
Reply
#11

forward LoadUser_AccountData(playerid,name[],value[]);
public LoadUser_AccountData(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Banned",PlayerInfo[playerid][banned]);
INI_Int("Warnings",PlayerInfo[playerid][Warnings]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Captures",PlayerInfo[playerid][pCaptures]);
INI_Int("Rank",ranklvl[playerid]);
return 1;
}
I can only make admins with change the numbers of account not ingame/
Reply
#12

You have to create the Makeadmin command in your script. You will need scripting knowledge for that.
Reply
#13

I dont made that command yet:P I added admin commands with if(playerinfo[playerid][pAdmin]==5)
Reply
#14

Well then if you want to make a player INGAME and not only via Scriptfiles, you should make one
Reply
#15

I Deleted the admin save. I just need to rcon login for admin but is that save?
Reply
#16

RCON administrator is on a whole different scale to Ingame Administrator as Ingame is a rank of somesort whereas RCON controlls the server entirely.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)