SA-MP Forums Archive
Register Problem, need assistance! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Register Problem, need assistance! (/showthread.php?tid=260099)



Register Problem, need assistance! - Vero - 07.06.2011

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!


AW: Register Problem, need assistance! - xerox8521 - 07.06.2011

Show us the register / login part


Re: Register Problem, need assistance! - shitbird - 07.06.2011

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


Re: Register Problem, need assistance! - Vero - 07.06.2011

EDIT: It is already like that


Re: Register Problem, need assistance! - shitbird - 07.06.2011

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



Re: Register Problem, need assistance! - Vero - 07.06.2011

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.


Re: Register Problem, need assistance! - shitbird - 07.06.2011

Can you show me the ResetPlayerVariables code?


Re: Register Problem, need assistance! - Vero - 07.06.2011

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?


Re: Register Problem, need assistance! - shitbird - 07.06.2011

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


Re: Register Problem, need assistance! - Vero - 07.06.2011

Right i will test that and report back here thanks