Retrieving PVars OnPlayerDisconnect - 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: Retrieving PVars OnPlayerDisconnect (
/showthread.php?tid=247554)
Retrieving PVars OnPlayerDisconnect -
Kieren - 09.04.2011
Hey all,
I'm having a bit of a problem using 'GetPVarString' when a player disconnects from the server, it's as if the variable is reset BEFORE OnPlayerDisconnect is called? GetPVarInt works fine, it's just PVar strings.
Now because my script uses a character system, the player's name is set to their selected character name, and their actual login same (The name you use on the SA-MP client) is set to a PVar for future use.
The problem is, when using GetPVarString under OnPlayerDisconnect, it doesn't return the string I have set. It's just blank. But if I were to use this anywhere else, it works perfectly. I would use GetPlayerName, but that would return their character name, which I don't want. The actual string I want is stored in the PVar "user_username".
Is this normal when getting PVars when a player disconnects? As this could cause more problems when saving a users data etc.
Any advice is appreciated!
Many Thanks