OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Lone-Wolf on 15 Apr 2009, 23:44:14

Title: removeAction by name Doesn't Work in MP!!!
Post 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:
Title: Re: removeAction by name Doesn't Work in MP!!!
Post by: Planck on 16 Apr 2009, 03:00:39
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
Title: Re: removeAction by name Doesn't Work in MP!!!
Post by: Lone-Wolf on 16 Apr 2009, 17:13:31
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.
Title: Re: removeAction by name Doesn't Work in MP!!!
Post by: Planck on 16 Apr 2009, 20:53:26
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