OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Lone-Wolf on 15 Apr 2009, 23:44:14
-
:whistle: Once again I'm baffled by a simple scripting problem.
When I attempt to remove an action by it's name (from a script) nothing happens.
_player removeAction TVaction1
The given player still has the action.
Help? :confused:
-
removeAction requires you to supply the index number of the action not the name of the action.
object removeAction index#
First action added to an object will have the index 0, the next would be index 1 ... etc.
Planck
-
Ok, I already knew that but I need to know how to remove a specific action. :dry:
It would be handy if someone could drop a tutorial or some notes on how to remove specific actions - be it by some special way of determining the reference number or otherwise.
Thanks.
-
When you first use addAction the returned value will be the index number of that action:
_index = addAction ["TVaction1", "TVaction.sqs"]
_index would then hold the index number of the action.
Planck