Setting variables to 0 on disconnect..?
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
It depends on what you want the default values to be. Most variables are 0 by default, so when the first players connect there is no need to set those values to 0 in OnPlayerConnect. Of course, they still need resetting at some point - hence OnPlayerDisconnect.

On the other hand, if the variables shouldn't be 0 by default then you may need to set them in OnPlayerConnect, in which case there is an argument for doing them all there for consistency.
Then again for consistency of data if the player is not connected you might want any values cleared as well in on OPD although you could check if the player is connected anyways. It's probably six of one, half a dozen of the other for the most part.
Reply


Messages In This Thread
Setting variables to 0 on disconnect..? [Solved] - by Capua - 07.11.2014, 19:27
Re: Setting variables to 0 on disconnect..? - by dominik523 - 07.11.2014, 20:11
Re: Setting variables to 0 on disconnect..? - by Capua - 07.11.2014, 20:36
Re: Setting variables to 0 on disconnect..? - by Abagail - 07.11.2014, 20:42
Re: Setting variables to 0 on disconnect..? - by AIped - 07.11.2014, 20:47
Re: Setting variables to 0 on disconnect..? - by Capua - 07.11.2014, 20:59
Respuesta: Setting variables to 0 on disconnect..? - by aoEXE - 08.11.2014, 00:16
Re: Setting variables to 0 on disconnect..? - by Pottus - 08.11.2014, 00:28
Re: Setting variables to 0 on disconnect..? - by MD5 - 08.11.2014, 01:18

Forum Jump:


Users browsing this thread: 1 Guest(s)