Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
GetPlayer_ functions do NOT work reliably in OnPlayerDisconnect because the client is already disconnected at that point.
Posts: 1,147
Threads: 109
Joined: Jul 2013
Reputation:
0
Just try it, because I use the GetPlayer_ functions under OnPlayerDisconnect() and I've never witnessed problems nor bugs til now.
Posts: 135
Threads: 37
Joined: Jan 2016
Reputation:
0
I do have a call function for OnPlayerDisconnect. But as vince said, maybe the force quit doesn't connected to GetPlayer_ functions.
Posts: 1,398
Threads: 25
Joined: Jan 2014
Reputation:
0
Create separate variable for storing money, score etc. Increment/decrement their value whenever the the change is needed. Now use this variable in OnPlayerDisconnect(). Do not forget to reset them after saving it in OnPlayerDisconnect().
Storing money in variable also helps to detect money hack. As if player uses a money cheat GetPlayerMoney will return then money value at from client side which could be changed with help of a hack but the value stored in variable you made in script won't change as it is server sided.
Posts: 293
Threads: 20
Joined: Jan 2017
Search in SA-MP forums for existing threads before posting
Check
OnPlayerDisconnect
Also, a similar thread :
https://sampforum.blast.hk/showthread.php?tid=512511