Register Problem, need assistance!
#1

Hey there,

My register system has messed up. I set my admin level to 5 and then every new player that joins also have level 5 admin! It's the same with Stimpacks (the way the player gets health) so it cannot be a bug which is just for setting admins. Please help!
Reply
#2

Show us the register / login part
Reply
#3

Reset the players admin variable OnPlayerConnect, and make sure it only loads the variable when they're logged in.
Reply
#4

EDIT: It is already like that
Reply
#5

pawn Код:
public OnPlayerConnect(playerid] {
    Admin[playerid] = 0; // replace with whatever admin variable you are using.
    return 1;
}
Reply
#6

pawn Код:
public OnPlayerConnect(playerid)
{
    ResetPlayerVariables(playerid);
    if(CheckUser(playerid))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Type in your password to login", "Login", "Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Type in wanted password to register", "Register", "Quit");
    }
    return 1;
}
Thats it atm with the reset variables at the top there.
Reply
#7

Can you show me the ResetPlayerVariables code?
Reply
#8

This is what is at the variable

pawn Код:
stock ResetPlayerVariables(playerid)
{
    IsLogged[playerid] = 0;
}
EDIT: So i need to add, but my admin variable ofc
pawn Код:
Admin[playerid] = 0;
to it and it should work?
Reply
#9

If that's the variable you're using for checking/setting the players admin status, then yes.
Reply
#10

Right i will test that and report back here thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)