Y_INI Stats 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: Y_INI Stats Problem. (
/showthread.php?tid=506865)
Y_INI Stats Problem. -
gatenosix - 14.04.2014
Hello,
I use Y_INI and everything seems fine with saving the information. However, there is a random problem where if a user creates an account, they may acquire the stats, partially or wholly, from an existing player. This is obviously a massive problem. I have no idea what code to post so if you request it, I will willingly post it.
Thanks!
Re: Y_INI Stats Problem. -
Ada32 - 14.04.2014
Quote:
Originally Posted by gatenosix
[..]if a user creates an account, they may acquire the stats, partially or wholly, from an existing player
|
like a random player? lets see how you load the data
Re: Y_INI Stats Problem. -
bool - 14.04.2014
Empty your variables under OnPlayerDisconnect.
I.E:
Код:
enum player
{canfly,
}
Код:
public OnPlayerDisconnect
{//save stuff
Player[playerid][canfly] = 0;
return 1;
}
Re: Y_INI Stats Problem. -
PrivatioBoni - 14.04.2014
@bool:
That would of course work for stuff which you don't want to have on connect (e.g. unanswered questions) however surely that would just cause the player to have reset stats when they login/connect? That wouldn't help, unless I misunderstood something.
Re: Y_INI Stats Problem. -
bool - 14.04.2014
Quote:
Originally Posted by PrivatioBoni
@bool:
That would of course work for stuff which you don't want to have on connect (e.g. unanswered questions) however surely that would just cause the player to have reset stats when they login/connect? That wouldn't help, unless I misunderstood something.
|
When they disconnect you save their stuff, then empty the variables.
When they connect, you load the stuff as per usual.
It wouldn't reset.
Re: Y_INI Stats Problem. -
PrivatioBoni - 14.04.2014
Oh right, understood. Thanks for that clarification. I think I misunderstood you!