Warning: file_put_contents(/ff_51e8595449eb2feba56b278ef6058e0a7c6bd4c14062f7f5.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
addAction - OFPEC Scripting Command Reference | OFPEC The Editing Center

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)