SA-MP Forums Archive
Login Script problem - 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: Login Script problem (/showthread.php?tid=501352)



Login Script problem - mrxqware - 17.03.2014

Dear Guys and Girls,


I'm facing a huge problem. In the beginning my players can register and login without problems, but after some time (1 day) players have to register again, while the player file exists. I don't know how or why?

In my opinion nothing changed.

This is the script I'm using:

Under
public OnPlayerConnect(playerid)
{

I have:
Код:
	GetPlayerName(playerid, string, sizeof(string));
	format(string, sizeof(string), "%s.ini", PlayerName(playerid));
	if(dini_Exists(string)) // This will check if the dini exists. returns true if exists.
	{
		gPlayerAccount[playerid] = 1;
		return 1;
	}
	else
	{
		gPlayerAccount[playerid] = 0;
		return 1;
	}
Under
public OnPlayerRequestClass(playerid, classid)
{

I have:

Код:
   if(gPlayerLogged[playerid] == 0)
    {
		switch(gPlayerAccount[playerid])
		{
		    case 0: DisplayDialogForPlayer(playerid, 2); //register
			case 1: DisplayDialogForPlayer(playerid, 1); //login
	    }
	}
When I restart the server again, everything works fine. Does anyone know what's wrong?


Re: Login Script problem - mrxqware - 18.03.2014

Please Could someone take a look for me? The userfiles are getting overwritten when the user has to register again. I don't know what to do.


AW: Login Script problem - Macronix - 18.03.2014

Remove this line:
pawn Код:
GetPlayerName(playerid, string, sizeof(string));
You are getting the name for the string variable but you are already using "PlayerName(playerid);" which is enough.