Jump to content
Sign in to follow this  
FriZY_SK

AddAction to explosives

Recommended Posts

Hello All,

I have a mission with task for defusing bomb. So, I placed explosive charges and tried to add action to them. Unfortunately it seems that it is not possible use addAction command to explosives.

 

Do you have any workarounds or suggestions?

I just placed pliers on explosive charges and add action to pliers. .... no best solution but it works this way.

 

Thanks for answers in advance.

Share this post


Link to post
Share on other sites

You can addAction to the player(s) and add a condition like:

cursorObject in allMines && {cursorObject distance2D _this < 15} //(condition param of the addAction)

 

 

  • Like 1

Share this post


Link to post
Share on other sites

This is a copy/paste from my latest mission:

_skript = 
{	private _obj = nearestObject [player, "TimeBombCore"];
	switch (typeOf _obj) do
	{	case "DemoCharge_Remote_Ammo": {deleteVehicle _obj; player addMagazine "DemoCharge_Remote_Mag";};
		case "ClaymoreDirectionalMine_Remote_Ammo": {deleteVehicle _obj; player addMagazine "ClaymoreDirectionalMine_Remote_Mag";};
		default {};
	};
	player playAction "PutDown";
};
_id = player addAction [localize "STR_Luk_13",_skript,nil,2,false,true,"","(player distance2D nearestObject [player, 'TimeBombCore']) <= 1.5"];

Its not defusing a bomb, but for take wrong placed bombs.

Player addActions are not resistent. After respawn call it again.

  • Like 2

Share this post


Link to post
Share on other sites

@pierremgi and Lucullus

Thanks for coments

 

I decided to use pierremgi solution

 

1. initialization of script and broadcast to everyone (included JIP) from SERVER

[[[bomb,bomb1,bomb2],"tasks\t5_bomb_init.sqf"],"BIS_fnc_execVM",true,true] spawn BIS_fnc_MP;

2. Add action on player side 

btw: make sure that function BIS_fnc_holdActionAdd is not started on server side. Otherwise it is not works.

	bomb = _this select 0;
	bomb1 = _this select 1;
	bomb2 = _this select 2;

	[ player,"Analyze bomb","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa","cursorObject in [bomb1,bomb2] && {_this distance2D bomb2 < 3}","_caller distance _target < 3",{[_this select 0,_this select 1,_this select 2,"WIP"] execVM "tasks\t5_bomb_a_analyze.sqf";},{},{[_this select 0,_this select 1,_this select 2,"DONE"] execVM "tasks\t5_bomb_a_analyze.sqf";},{},[],4,10,false,false] call BIS_fnc_holdActionAdd;
	[ player,"Cut left wire","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","cursorObject in [bomb1,bomb2] && {_this distance2D bomb2 < 3}","_caller distance _target < 3",{},{},{[_this select 0,_this select 1,_this select 2,"left"] execVM "tasks\t5_bomb_a_cut.sqf";},{},[],4,9,true,false] call BIS_fnc_holdActionAdd;
	[ player,"Cut right wire","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","cursorObject in [bomb1,bomb2] && {_this distance2D bomb2 < 3}","_caller distance _target < 3",{},{},{[_this select 0,_this select 1,_this select 2,"right"] execVM "tasks\t5_bomb_a_cut.sqf";},{},[],4,8,true,false] call BIS_fnc_holdActionAdd;

 

  • Like 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
Sign in to follow this  

×