Posts: 100
Threads: 14
Joined: Sep 2014
Reputation:
0
07.11.2014, 19:27
(
Последний раз редактировалось Capua; 07.11.2014 в 20:36.
Причина: Solved
)
I've noticed that many people in their gamemodes set player variables to 0 when they disconnect. Let's say there's a variable named "Muted". It's set to 0 on onplayerconnect. Still many people sets it back to 0 on onplayerdisconnect. As far as I know, I think that's completely unnecessary. But I'd like to hear your opinion about that. Why do people do that?
Posts: 843
Threads: 61
Joined: Feb 2013
Reputation:
0
I'm setting everything to 0 when the player disconnects. I don't see the point of resetting it again under OnPlayerConnect
Posts: 100
Threads: 14
Joined: Sep 2014
Reputation:
0
Oh uh! Nevermind this! I thought that player variables would go back to 0 upon reconnect even though not set back to 0!
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
They probably just have no idea what they're doing, and really aren't experienced scripters. Or, maybe there's a reason dependent on that certain script, how-ever I personally wouldn't reset them both on both of those conditions.
Posts: 789
Threads: 36
Joined: Dec 2013
Reputation:
0
is because they not understand whats works your code. If is configured the value to default on OnPlayerDisconnect is not necessary the setting again on OnPlayerConnect
Posts: 247
Threads: 22
Joined: Nov 2014
Reputation:
0
Setting the variables to 0 in "OnPlayerDisconnect" is just to clarify the player's stats reset (when not logged in). That way it doesn't say something like you have "5 Score" on a connection.