Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn_findNearby.sqf
- //Exit if client side
- if (!isServer && isMultiplayer) exitWith {};
- params["_unit","_side","_shooter", "_nearestunits", "_nearestfriendlies", "_a"];
- _unit = _this select 0;
- _side = side _unit;
- _shooter = _this select 1;
- _nearestunits = nearestObjects [getpos _unit ,["Man"], 1000];
- _nearestfriendlies = [];
- if(_side countSide _nearestunits > 0) then{
- {
- _a = _x;
- if((side _a == _side) && (group _a != group _unit) && !(behaviour leader (group _a) isEqualTo "COMBAT")) then{
- _nearestfriendlies = _nearestfriendlies + [_a];
- [group _a, getpos _shooter, 100] call CBA_fnc_taskAttack;
- };
- } foreach _nearestunits;
- };
- fn_getHitEvent.sqf
- //Exit if client side
- if (!isServer && isMultiplayer) exitWith {};
- _aiUnits = [];
- {
- _unit = _x;
- if !(isPlayer _unit) then
- {
- _unit addEventHandler ["Hit",{_this call fn_findNearby}];
- };
- }foreach allUnits;
- postinit.sqf
- fn_getHit = call compile preProcessFile "functions\fn_getHitEvent.sqf";
- fn_findNearby = compile preprocessFileLineNumbers "functions\fn_findNearby.sqf";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement