Register/login problem... Please help!!
#1

Hi

I made a very own register/login script but I experience a problem. It works, but when I disconnect and connect to server back again, cash is gone, although it is saved in the scriptfiles on player's account. Same applies to score, but weirdly, its under /mystats, and isnt on TAB. Yes, it should be like that, but why isnt it on TAB? Below, I want to tell PAWNO to save the cash, Is that public below correct? And what do I need to add to tell it to save the cash and score.

Код:
new LogOff[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
  OnPlayerUpdate(playerid);
	if(IsPlayerConnected(playerid))
	{
		if(LogOff[playerid])
		{
			}
		}
	}
	return 1;
}
Reply
#2

Just to remind you if you're using GF/GF edit: OnPlayerUpdate already exists in sa-mp.
Reply
#3

Quote:
Originally Posted by Don Correlli
Just to remind you if you're using GF/GF edit: OnPlayerUpdate already exists in sa-mp.
No, I am using own made script for Team Deathmatch. I dont quite understand you what you mean with OnPlayerUpdate
Reply
#4

Quote:
Originally Posted by Puzi
Quote:
Originally Posted by Don Correlli
Just to remind you if you're using GF/GF edit: OnPlayerUpdate already exists in sa-mp.
No, I am using own made script for Team Deathmatch. I dont quite understand you what you mean with OnPlayerUpdate
Did you created your own OnPlayerUpdate? Because there is callback called OnPlayerUpdate which is done by SA-MP.
Reply
#5

You have a brace which doesn't belong here, that's all I'm saying.

pawn Код:
new LogOff[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
    // OnPlayerUpdate(playerid); // This shouldn't be here, because SA-MP already has a callback like so. Rename the function to something else?
    if(IsPlayerConnected(playerid))
    {
        if(LogOff[playerid])
        {
            // Script here I'd say.
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by [SAP
Francis ]
You have a brace which doesn't belong here, that's all I'm saying.

pawn Код:
new LogOff[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
    // OnPlayerUpdate(playerid); // This shouldn't be here, because SA-MP already has a callback like so. Rename the function to something else?
    if(IsPlayerConnected(playerid))
    {
        if(LogOff[playerid])
        {
            // Script here I'd say.
        }
    }
    return 1;
}
Yea, but my friend said so it should, cause it updates player's score and etc. when he comes back :S
And what script? That's what I was asking for... I am dumb
Reply
#7

Quote:
Originally Posted by Puzi
Quote:
Originally Posted by [SAP
Francis ]
You have a brace which doesn't belong here, that's all I'm saying.

pawn Код:
new LogOff[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
    // OnPlayerUpdate(playerid); // This shouldn't be here, because SA-MP already has a callback like so. Rename the function to something else?
    if(IsPlayerConnected(playerid))
    {
        if(LogOff[playerid])
        {
            // Script here I'd say.
        }
    }
    return 1;
}
Yea, but my friend said so it should, cause it updates player's score and etc. when he comes back :S
And what script? That's what I was asking for... I am dumb
You don't need to.
You're calling the callback by script, it has nothing to do with client&server's update.
eg:You call OnPlayerEnterVehicle by script, does the player enter the vehicle?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)