SA-MP Forums Archive
Unloading 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: Unloading problem! (/showthread.php?tid=436799)



Unloading problem! - lQs - 12.05.2013

/solved


AW: Unloading problem! - HurtLocker - 12.05.2013

If the admin level is directly loaded from the player's .ini file you shouldn't face this problem.


Re: Unloading problem! - lQs - 12.05.2013

Okay. The problem is really serious, because when i logged on my main acc, and then created new acc on same ID i have same phone number, kills amount and everything like on my main acc. how i can fix it?


AW: Unloading problem! - HurtLocker - 12.05.2013

There is a issue of logic with your register/login system. Check it carefully.


Re: Unloading problem! - lQs - 12.05.2013

/solved


Re: Unloading problem! - Goldilox - 12.05.2013

What player ID is that on which the data gets duplicated?


Re: Unloading problem! - lQs - 12.05.2013

It happens on random IDs. 0, 1 and others.


Re: Unloading problem! - Pawnie - 12.05.2013

Add something like this.

Код:
public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra = true, .extra = playerid);
		ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");
		SendClientMessage(playerid, COLOR_YELLOW, "Welcome back to Blood Zone. We hope you will enjoy your stay!");
        	if(PlayerInfo[pAdmin] >= 1)
			{
	    		//Add message etc...
			}
			else
			{
				PlayerInfo[playerid][pAdmin] = 0;
			}
	}
    else
    {
        ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
		return 1;
  	}



Re: Unloading problem! - lQs - 12.05.2013

It doesnt works.


Re: Unloading problem! - Chenko - 12.05.2013

You need to reset the playerid's variables before they login. So under OnPlayerConnect before the dialogs to log in are shown you need to do something like this:

PHP код:
PlayerInfo[playerid][pHours] = 0;
PlayerInfo[playerid][pAdmin] = 0;
etc
Then show them the dialog and load their data if the password is correct, etc.