Jump to content
Nikoladis

Allow players to cancel tasks

Recommended Posts

I would like to allow players to cancel tasks. I know it can be done cause I have seen missions where tasks can be canceled.

 

But my tasks, which is made by modules cannot be canceled by players, they simply dont get the option.

Share this post


Link to post
Share on other sites

@Nikoladis,
You can add a cancel task hold action to the action menu,

cancelTask=[ 
 player, 
 "Cancel Task", 
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
 "alive player", 
 "alive player", 
 {}, 
 {}, 
 { 

_this setTaskState "canceled";

}, 
 {}, 
 [], 
 2, 
 0, 
 false, 
 true 
] call BIS_fnc_holdActionAdd;

Have fun!

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you for the reply. However I am not sure where to put that code. Should it work with tasks that are made as modules also?
Should it pop up in the menu for the player that comes up when I use mouse scrollwheel?

Share this post


Link to post
Share on other sites

You can do it in the createTask module by placing...

<execute expression="[  'task_1', 'CANCELED' ] call BIS_fnc_taskSetState">CANCEL</execute>

..in the description box. Where 'task_1' is the taskID.

Or from script.

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×