Home   Help Search Login Register  

Author Topic: Dynamic variables  (Read 456 times)

0 Members and 1 Guest are viewing this topic.

Acecool

  • Guest
Dynamic variables
« on: 08 Feb 2005, 13:01:04 »
Hey, Ive searched and looked, is it possible to use a foreach with a list to create variables?

_Players = ["p1","p2","p3","p4","p5", "c1","c2","c3","c4","c5","c6","c7","c8","c9","c10"]
"Hint {_x_Dynamic_Variable}" foreach _Players


instead of
p1_License_Vehicle_Car = FALSE
p2_License_Vehicle_Car = FALSE
p3_License_Vehicle_Car = FALSE
p4_License_Vehicle_Car = FALSE
p5_License_Vehicle_Car = FALSE
c1_License_Vehicle_Car = FALSE
c2_License_Vehicle_Car = FALSE

etc?

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:Dynamic variables
« Reply #1 on: 08 Feb 2005, 14:19:01 »
Look no further than to the format command:
Code: [Select]
{call format ["%1_Licence_Vehicle_Car=false", _x]} forEach ["p1","p2","p3","p4","p5","c1","c2","c3","c4","c5","c6","c7","c8","c9","c10"]or
Code: [Select]
{call format ["%1_Licence_Vehicle_Car=false", _x]} forEach _PlayersA variation is to do
Code: [Select]
{call format ["p%1_License_Vehicle_Car=false", _x]} forEach [1,2,3,4,5]
{call format ["c%1_License_Vehicle_Car=false", _x]} forEach [1,2,3,4,5,6,7,8,9,10]
« Last Edit: 08 Feb 2005, 14:24:39 by Killswitch »

Acecool

  • Guest
Re:Dynamic variables
« Reply #2 on: 08 Feb 2005, 15:18:38 »
Very nice, thank you :-)


###

Worked perfectly, thanks :-)
I am wondering if you have any free time to help with dialogs, and possibly a few other things..

Dialog is made, just need help making an image change / appear when you select a different item and being able to purchase that item...  having that item assigned to that player lol... Been searching cant find any answer :-/
« Last Edit: 08 Feb 2005, 15:29:45 by Acecool »

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Dynamic variables
« Reply #3 on: 08 Feb 2005, 16:24:12 »
You can run a ? statement and check if the cursel of the control has changed, then change picture.

:beat: *Get Shot* :beat: