I want to control when a hud activates/deactives per player. (another function changes i.alpha when triggered) The problem is if I run i.alpha = 1; it will change everybodies huds.
I know two possible solutions. Dynamic variables or
Code Snippet
Plaintext
players = getplayers(); for players.size { players[i].hud.alpha = 0; //Any idea if there is an index of 'player' that makes this line of code possible? }
Dynamic Variable: This method throws an error. This way should work because each time it creates a new hud object with a new variable. Anyone know a different method that may work?
Code Snippet
Plaintext
function hud() { players = getplayers(); level.hud = []; for (i=0; i<players.size; i++) { abc = asdf+i; level.hud[i] = NewClientHudElem(players[i]);//I also tried level.i = NewCli... (This compiled but didn't work.) level.hud[i].foreground = true; level.hud[i].fontScale = 1.5; level.hud[i].fontType = "default"; //etc. level.i.sort = 1; level.i.hidewheninmenu = true; level.i.alignX = "left"; level.i.alignY = "bottom"; level.i.horzAlign = "left"; level.i.vertAlign = "bottom"; level.i.x = 35; level.i.y -= 125; level.i.alpha = 1; //eventually be 0 level.i SetText("Stocks: "+level.cash); //Yes, you will be able to collect interest at a 'bank' in my map. } }
Last Edit: January 19, 2017, 01:09:55 am by MegaMech43