{"name":"removeAllActions","operator":null,"title":"removeAllActions","type":"command","url":"https://community.bistudio.com/wiki/removeAllActions","revid":329338,"updated":"2022-07-27T10:37:51Z","groups":["Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"local","server_exec":false},"exec":null,"description":"Removes all unit's user added actions.\n\n> [!NOTE]\n> This command's syntax was `unit removeAllActions number` from Arma 3 v0.50 to v1.06.\n\n> [!IMPORTANT]\n> Usage of this command is usually a bad practice unless justified by the situation; removing all actions in order to remove all actions that *one* added is not a good method as a mod or another script could have added its own actions as well and see them removed. Instead, store the action id returned by addAction either in a script variable or using setVariable.","syntaxes":[{"syntax":"removeAllActions obj","since":null,"effect":null,"exec":null,"params":[{"name":"obj","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"obj: Object"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"obj","types":["Object"]}}],"examples":[{"text":"```sqf\nremoveAllActions player;\n```","code":["removeAllActions player;"]},{"text":"Do\n\n```sqf\nprivate _actionId = player addAction [\"Heal self\", { player setDamage 0; }];\n// ...\nplayer removeAction _actionId;\n```\n\nDon't\n\n```sqf\nplayer addAction [\"Heal self\", { player setDamage 0; }];\n// ...\nremoveAllActions player;\n```","code":["private _actionId = player addAction [\"Heal self\", { player setDamage 0; }];\n// ...\nplayer removeAction _actionId;","player addAction [\"Heal self\", { player setDamage 0; }];\n// ...\nremoveAllActions player;"]},{"text":"Do\n\n```sqf\nplayer addAction [\"Heal self (once)\", {\n    params [\"_target\", \"\", \"_actionId\"];\n    _target setDamage 0;\n    _target removeAction _actionId;\n}];\n```\n\nDon't\n\n```sqf\nplayer addAction [\"Heal self (once)\", {\n    player setDamage 0;\n    removeAllActions player;\n}];\n```","code":["player addAction [\"Heal self (once)\", {\n\tparams [\"_target\", \"\", \"_actionId\"];\n\t_target setDamage 0;\n\t_target removeAction _actionId;\n}];","player addAction [\"Heal self (once)\", {\n\tplayer setDamage 0;\n\tremoveAllActions player;\n}];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["actionIDs","actionParams","addAction","setUserActionText","inGameUISetEventHandler","showHUD","inputAction","removeAction","action"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Introduced with Arma 3 version 0.50","Scripting Commands","Scripting Commands: Local Effect"]}