Home   Help Search Login Register  

Author Topic: Limiting repetition of an action?  (Read 1036 times)

0 Members and 1 Guest are viewing this topic.

SEAL84

  • Guest
Limiting repetition of an action?
« on: 27 Aug 2002, 20:50:04 »
Just wondering if this is possible...i.e. keep track of how many times the player uses a custom action and then removes it from the menu after it has been used X amount of times.

Here's what I did....I added an action that camcreates flares at the chopper (they fall a little before igniting...looks cool and took about 3 seconds to do), and every time you use the action it fires one flare.  Is there a way to limit the number of times I can select the action?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Limiting repetition of an action?
« Reply #1 on: 27 Aug 2002, 20:58:31 »
Easily, with a global variable, just put something like:

flares_fired=flares_fired+1

at the very beginning of the script. Beneath it, put something like:

?flares_fired == desired# : Player removeAction ActionId

you might want to define the variable flares_fired first, for instance in your init.sqs.

So, once you've fired it as many times as you wanted, the action is removed (however the final fired script obviously finishes first)

That should solve it ;)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"