Question about PVars.
#1

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
Reply
#2

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)
Reply
#3

They are still available on OnPlayerDisconnect callback.
Reply
#4

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

Thanks for the help guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)