SA-MP Forums Archive
Question regarding player variables - 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)
+--- Thread: Question regarding player variables (/showthread.php?tid=628006)



Question regarding player variables - AndreiWow - 04.02.2017

I got this question.

For example if I have this variable
PHP код:
new ExampleVar[MAX_PLAYERS]; 
And I set it somewhere like this:
PHP код:
ExampleVar[playerid] = 1
Let's say the player with ID 12 uses the command and the variable is set for him, if he disconnect from the server and another player log in, the ID 12 will be assigned to him, will the variable for him be 1? Or will it reset back to 0?

Do I have to set all player variables to 0 when a player disconnect?


Re: Question regarding player variables - AjaxM - 04.02.2017

Yes, it is possible. Set the variable back to 0 when the player disconnects.