Login Script problem
#1

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?
Reply
#2

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.
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)