Question about PVars. - 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: Question about PVars. (
/showthread.php?tid=273615)
Question about PVars. -
Danny - 02.08.2011
Hello,
I'm making a script that's totally based on PVars. Almost all player info is saved in player variables.
Now i noticed the following problem: Sometimes the stats aren't saved correctly. For example: I was 1337 admin, and when i joined my level was 0. Suddenly i realised that PVars will be deleted when a player disconnects.
When they will be deleted?
Before OnPlayerDisconnect or
after it? This is crucial for my stats saving system.
Greetz,
Danny
Re: Question about PVars. -
CJ101 - 02.08.2011
They are deleted when a player disconnects. I Suggest you write some code to save the stats into a file or database (and load them back)
Re: Question about PVars. -
Macluawn - 02.08.2011
They are still available on OnPlayerDisconnect callback.
Re: Question about PVars. -
Calgon - 02.08.2011
PVars are deleted after OnPlayerDisconnect, I've updated the wiki page (
https://sampwiki.blast.hk/wiki/Per-player_variable_system) to explain this a little better, too.
Re: Question about PVars. -
Danny - 02.08.2011
Thanks for the help guys