Register/login problem... Please help!! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Register/login problem... Please help!! (
/showthread.php?tid=88925)
Register/login problem... Please help!! -
Puzi - 29.07.2009
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;
}
Re: Register/login problem... Please help!! -
Correlli - 29.07.2009
Just to remind you if you're using GF/GF edit: OnPlayerUpdate already exists in sa-mp.
Re: Register/login problem... Please help!! -
Puzi - 29.07.2009
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
Re: Register/login problem... Please help!! -
Correlli - 29.07.2009
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.
Re: Register/login problem... Please help!! -
Francis[French] - 29.07.2009
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;
}
Re: Register/login problem... Please help!! -
Puzi - 31.07.2009
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
Re: Register/login problem... Please help!! -
yezizhu - 31.07.2009
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?