Arma 3
Call of Duty 4 - Modern Warfare [RU]
This topic has been locked
Leopard20 11 Nov, 2019 @ 9:35am
Fixing friendly fire
To make sure the player doesn't take damage from friendly fire, just add a "handleDamage" event handler to the player which returns 0 damage if the instigator is friendly (something like this):
player addEventHandler ["HandleDamage", { _unit = _this#0; _damage = _this#2; _firing = _this#6; if ([side _firing, side _unit] call BIS_fnc_sideIsFriendly) then {_damage = 0}; _damage }];
Last edited by Leopard20; 11 Nov, 2019 @ 11:59am
< >
Showing 1-2 of 2 comments
▽ Eriks0n  [developer] 11 Nov, 2019 @ 9:52am 
:D
Oookay, I'll try to implement.
▽ Eriks0n  [developer] 11 Nov, 2019 @ 11:55am 
Thanks, it works. Checked on the "Crew expendable" mission. Soon the rest of the mission will put this code.
< >
Showing 1-2 of 2 comments
Per page: 1530 50