26.08.2015, 12:20
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.
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.

