24.01.2017, 21:27
Quote:
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. |