BNRG fnc suicideBomber

From Benargee's Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Code

Define this somewhere first!

BNRG_fnc_suicideBomber = {
_expl1 = "DemoCharge_Remote_Ammo_Scripted" createVehicle (position _this);
_expl1 attachTo [_this, [-0.1,0.1,0.15],"Pelvis"];
_expl1 setVectorDirAndUp [[0.5,0.5,0],[-0.5,0.5,0]];
_this setVariable ["expl1", _expl1];
_expl2 = "DemoCharge_Remote_Ammo_Scripted" createVehicle (position _this);
_expl2 attachTo [_this, [0,0.15,0.15],"Pelvis"];
_expl2 setVectorDirAndUp [[1,0,0],[0,1,0]];
_this setVariable ["expl2", _expl2];
_expl3 = "DemoCharge_Remote_Ammo_Scripted" createVehicle (position _this);
_expl3 attachTo [_this, [0.1,0.1,0.15],"Pelvis"];
_expl3 setVectorDirAndUp [[0.5,-0.5,0],[0.5,0.5,0]];
_this setVariable ["expl3", _expl3];
_this addAction ["Allahu Akbar", 
	{
		_bomber = (_this select 0); 
		_bomber removeAction (_this select 2);
		{(_bomber getVariable _x) setdamage 1} foreach ["expl1", "expl2", "expl3"];
	}, 
	nil, 1.5, true, true, "", "cameraon == _target" ];
true;
};

Syntax

_unit call BNRG_fnc_suicideBomber;

_unit: Object

Examples

Inside a unit's init field

null = this call BNRG_fnc_suicideBomber;