Home   Help Search Login Register  

Author Topic: removeAction formated in script ?  (Read 1085 times)

0 Members and 1 Guest are viewing this topic.

Offline schuler

  • Contributing Member
  • **
removeAction formated in script ?
« on: 08 Nov 2007, 11:26:29 »
how do I get a removeAction to work in this script?  need to kill the menu command of "deactivate nuke".
Quote
; player addAction ["deactivate nuke", "deactivate.sqs"]



TitleText [format["Deactivating Nuke"], "PLAIN DOWN"]
~1
TitleText [format[""], "PLAIN DOWN"]



player playmove "medic"
~6
player playmove "null"

TitleText ["Nuke is deactivated.", "Plain"]
~1


deletevehicle t4
deletevehicle t5

exit
Semper Fi

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: removeAction formated in script ?
« Reply #1 on: 08 Nov 2007, 12:26:08 »
Well, for one, I'd put the action on the vehicle, not on the player. That way you don't have to worry about the player deactivating the nuke 10 km from the car!
Code: [Select]
nukeCar addAction ["deactivate Nuke", "deactivate.sqs"];

Then, in the script, you should make use of the standard parameters sent to action scripts to avoid having to hardcode player in the script or a global variable to store the action index:
Code: (deactivate.sqs) [Select]
_actionObject =  _this select 0; // The nuke car.
_actor = _this select 1; // The player OR AI soldier performing the action.
_actionIndex = _this select 2;

_actionObject removeAction _actionIndex; // Remove at start of script, to prevent additional use of the action during deactivation process.

TitleText [format["Deactivating Nuke"], "PLAIN DOWN"]
~1
TitleText [format[""], "PLAIN DOWN"]

_actor playmove "medic"
~6
_actor playmove "null"

TitleText ["Nuke is deactivated.", "Plain"]
~1

deletevehicle t4
deletevehicle t5

exit
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline schuler

  • Contributing Member
  • **
Re: removeAction formated in script ?
« Reply #2 on: 08 Nov 2007, 13:23:17 »
thanks spooner,  :D  i did have the trigger set to activate in the player menu command at 3m from vehicle by west present
but i'll put it in the jeep
Semper Fi