Local vs Global variables

Gary Brown
23 Mar 2005, 14:24
Okay, silly question here. How does one assign a variable so that's it's specificly for the player object. I've set up a procedure to set player stats, (strength, dex, iq, health) but if I change them on one player they get changed on any other players. Obviously I've screwed up and set them as global variables. I've missed something obvious. Any help would be appreciated. : )

Alex
24 Mar 2005, 00:58
You use arrays with the index being the userid. So instead of using a "health" variable, you use "health[userid]".

Gary Brown
24 Mar 2005, 14:05
Ah. Okay, thanks. :)

METALGod32
09 May 2005, 05:12
Cool, Thanks to this thread this solved my prob to, Thanks :)