Home   Help Search Login Register  

Author Topic: Variable in AddAction Name  (Read 1095 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Variable in AddAction Name
« on: 26 May 2007, 18:56:59 »
Hi

Simple question, but to a difficult answer..

How can I use a variable in the AddAction Name?

I tried:
Code: [Select]
value = "value variable"
this addaction ["format ["%1",value]",script1.sqs]

No luck.. Any idea guys?

Cheers.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Variable in AddAction Name
« Reply #1 on: 26 May 2007, 19:16:41 »
Looking at your example:

Code: [Select]
value = "value variable"
_actionname = format ["%1",value]
this addaction [_actionname,"script1.sqs"]

Am I missing something  :blink:

Offline Cheetah

  • Former Staff
  • ****
Re: Variable in AddAction Name
« Reply #2 on: 26 May 2007, 21:31:15 »
Seems like JasonO forgot to remove the " ", right now there would be a double string ("" with a string inside).

If it still doesn't work, I am missing something too.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Variable in AddAction Name
« Reply #3 on: 27 May 2007, 05:09:21 »
lol just finished playing with PHP and i've been writing things like stuff = "this";
I didn't copy and paste the variable line, only the addaction line so I quickly wrote it in my post... woops  :-[

I'll try what you've said tomorrow when I have access to my computer again. Thanks guys.