{"name":"removeAllActions","title":"removeAllActions","type":"command","url":"https://community.bistudio.com/wiki/removeAllActions","revid":329338,"updated":"2022-07-27T10:37:51Z","groups":["Interaction"],"status":"ok","games":{"arma3":"0.50"},"since":"arma3 0.50","arma3_since":"0.50","locality":{"argument":"global","effect":"local"},"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","params":[{"name":"obj","type":"Object","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"obj"}}],"examples":[{"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}];"]}],"see_also":["actionIDs","actionParams","addAction","setUserActionText","inGameUISetEventHandler","showHUD","inputAction","removeAction","action"]}