Which one would be better to use?
#7

Global variables are not stored on the stack.

I generally try to discourage the use of globals, but in this particular case I'd gladly make an exception, because of how widely it will be used and there being almost zero chance that a player's name will change while he's connected (the exception being SetPlayerName, of course, which must be caught). Accessing a variable is much faster than calling a function. And if you use a wrapper like GetName() then that will be even slower, still.
Reply


Messages In This Thread
Which one would be better to use? - by Sjn - 26.08.2015, 11:22
Re: Which one would be better to use? - by Runn3R - 26.08.2015, 11:38
Re: Which one would be better to use? - by Gammix - 26.08.2015, 11:38
Re: Which one would be better to use? - by Runn3R - 26.08.2015, 11:41
Re: Which one would be better to use? - by Sjn - 26.08.2015, 12:00
Re: Which one would be better to use? - by Runn3R - 26.08.2015, 12:13
Re: Which one would be better to use? - by Vince - 26.08.2015, 12:20

Forum Jump:


Users browsing this thread: 1 Guest(s)