Jump to content
Sign in to follow this  
davidoss

How to pass (vehicle x) into x array

Recommended Posts

HI.

 

How to pass unit in vehicle (vehicle _x) to units array.

 

I need this for script which adds ace 3 damage to a unit.

The problem is when the unit is in vehicle ace3 is going crazy because ace3 get (vehicle _x) to damage it

or is something wrong with damage reduction in variable _damagered.

//trigger cond : 
//{_player = _x; alive _player && {_player in crew _x} count thisList > 0} count (allPlayers - entities "HeadlessClient_F") isEqualTo ({ alive _x } count (allPlayers - entities "HeadlessClient_F"))

/*
	nul = [thisList, 0.2] spawn INS_fnc_radiationdamage2;

*/

//INS_fnc_radiationdamage2

private ["_unitsaray", "_damagestarke", "_shielduform", "_shieldhelm", "_shieldmask", "_damagered", "_bodypart"];
_unitsaray = _this select 0;
_damagestarke = _this select 1;
_damagered = _damagestarke/5;
_bodypart = [];
_shielduform = "U_mas_usn_B_wint";
_shieldhelm = "H_CrewHelmetHeli_B";
_shieldmask = "G_mas_wpn_gasmask";

while {true} do {
_bodypart = ["head","body","hand_l","hand_r","leg_l","leg_r"] call BIS_fnc_selectRandom;	
{
	if (alive _x and side _x == WEST) then {
		
		if (!(vehicle _x == _x) || (uniform _x == _shielduform) and (headgear _x == _shieldhelm) and (goggles _x == _shieldmask)) then {
			[_x, _damagered] call ace_medical_fnc_adjustPainLevel;
			[_x, _bodypart, (_x gethit _bodypart) + _damagered, objNull, "Bullet"] call ace_medical_fnc_handleDamage;

		} else {
			[_x, _damagestarke] call ace_medical_fnc_adjustPainLevel;
			[_x, _bodypart, (_x gethit _bodypart) + _damagestarke, objNull, "Bullet"] call ace_medical_fnc_handleDamage;
			_bodypart = ["head","body","hand_l","hand_r","leg_l","leg_r"] call BIS_fnc_selectRandom;
			[_x, _bodypart, (_x gethit _bodypart) + _damagestarke, objNull, "Bullet"] call ace_medical_fnc_handleDamage;
		};
	};
} forEach _unitsaray;
sleep 600;
};

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  

×