SA-MP Forums Archive
Registration system... - 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)
+--- Thread: Registration system... (/showthread.php?tid=432244)



Registration system... - dorperez - 21.04.2013

Hello,

I have a little problem,when I shutting my server down and start it again it tells me to register again but when I don't sutting down the server,but just relog it works perfectly..

Can you help me guys ?


Re: Registration system... - Frede - 21.04.2013

How does your login/register system looks like


Re: Registration system... - dorperez - 21.04.2013

Quote:
Originally Posted by Frede
Посмотреть сообщение
How does your login/register system looks like
I am using YSI\y_ini.


Re: Registration system... - Faisal_khan - 21.04.2013

Show us some of your loading and saving data code.


Re: Registration system... - dorperez - 21.04.2013

I think this code is the main problem..
pawn Код:
if (PlayerInfo[playerid][pRegisted] == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Welcome To Base RolePlay !",""COL_WHITE"Please enter your new password in order to register:","Register","Quit");

    }
    if (PlayerInfo[playerid][pRegisted] == 1)
    {
        if(fexist(UserPath(playerid)))
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered,please write your password below in order to log in! ","Login","Quit");
        }
    }



Re: Registration system... - Frede - 21.04.2013

How do you check if a player exist

Right now the problem looks easy. When you register your pRegister turn to 1, but your check variable doesnt return 1, so therefore you cant login.


Re: Registration system... - dorperez - 21.04.2013

Look at this line in the code above:
pawn Код:
if(fexist(UserPath(playerid)))



Re: Registration system... - Faisal_khan - 21.04.2013

Quote:
Originally Posted by dorperez
Посмотреть сообщение
Look at this line in the code above:
pawn Код:
if(fexist(UserPath(playerid)))
That is to check if the file exist. Please show more lines related data saving.


Re: Registration system... - Frede - 21.04.2013

Quote:
Originally Posted by dorperez
Посмотреть сообщение
Look at this line in the code above:
pawn Код:
if(fexist(UserPath(playerid)))
I mean how do you check that pRegister is 1 and not 0


Re: Registration system... - dorperez - 21.04.2013

I fixed it,thank you guys very much