Unloading problem!
#1

/solved
Reply
#2

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

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

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

/solved
Reply
#6

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

It happens on random IDs. 0, 1 and others.
Reply
#8

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;
  	}
Reply
#9

It doesnt works.
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)