unit addAction [action, script filename, (arguments, priority, showWindow, hideOnUse, shortcut)]

Operand types

unit: Object
[action, script filename, (arguments, priority, showWindow, hideOnUse, shortcut)]: Array

Type of returned value


Creates an action.
Action ID is returned, you may use this returned number to remove the action later.

Only the first two elements of the second parameter (array) are needed for OFP.

action argument may be a plain text or a structured text.

If you need to pass arguments to the script executed by the action, use the third argument of addAction. You may pass anything there, for example an array with parameters for the script.

Used In



_myactionid = player addAction ["Hello", "hello.sqs"]

kilgore addAction ["<img image='action_surf.paa' size='3' shadow='false'/>", "doSurf.sqf"];

(Thanks to Worldeater for this last usage example)