Does the server null's the values of enums autmaticaly
#1

So, i wanted to ask if server nulls the values of enums datas automaticaly when a player disconnects or i should do this by myself?
Reply
#2

I believe you mean reset, but yes, you need to reset the values yourself.

PVars reset when a player disconnects though.
Reply
#3

Yes it's always '0' or 'false' standard.
(false if it's a bool, 0 if it's a string).

I mean, if you don't give it a value, it hasn't got a value yet. You know that? And '0' is nothing
Very basic told but true

EDIT:
Didn't read it good enough, sorry. You said 'when player disconnets'
Like already told, you have to do it yourself!
See it like this:

You have an 'Money[MAX_PLAYERS]' that stores the players money into a string. The max length of the array of the 'Money' is MAX_PLAYERS (standard 500). When someone with ID 3 has 5 dollar, the 'Money' in range '3' is '5'.
When a player disconnects, the array will still exist! So when someone connects with ID 3, he'll have '5' into the 'Money', array '3'. Got it?
Reply
#4

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Yes it's always '0' or 'false' standard.
(false if it's a bool, 0 if it's a string).

I mean, if you don't give it a value, it hasn't got a value yet. You know that? And '0' is nothing
Very basic told but true

EDIT:
Didn't read it good enough, sorry. You said 'when player disconnets'
Like already told, you have to do it yourself!
See it like this:

You have an 'Money[MAX_PLAYERS]' that stores the players money into a string. The max length of the array of the 'Money' is MAX_PLAYERS (standard 500). When someone with ID 3 has 5 dollar, the 'Money' in range '3' is '5'.
When a player disconnects, the array will still exist! So when someone connects with ID 3, he'll have '5' into the 'Money', array '3'. Got it?
Yes yes, thank you! That explains the bugs in my server. LOL. Good that i thought to ask about that...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)