From fcab46dc22f3cf035fe94c34ecac5faf36eb35f2 Mon Sep 17 00:00:00 2001 From: Chase <29675446+theace0296@users.noreply.github.com> Date: Sat, 21 May 2022 20:56:43 -0400 Subject: [PATCH] force hvt to stay in obj position if not rescue mission --- RandFramework/Missions/hvtMission.sqf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RandFramework/Missions/hvtMission.sqf b/RandFramework/Missions/hvtMission.sqf index 158fd149..83a715bb 100644 --- a/RandFramework/Missions/hvtMission.sqf +++ b/RandFramework/Missions/hvtMission.sqf @@ -85,6 +85,18 @@ MISSION_fnc_CustomMission = { //This function is the main script for your missio _objInformant setPos (_flatPosInform); }; + if (_hvtType isNotEqualTo "RESCUE") then { + [_objInformant, _initPos] spawn { + waitUntil { + sleep 10; + if (((this # 0) distance (_this # 1)) > 100) then { + (this # 0) setPos (_this # 1); + }; + !(alive (_this # 0)); + }; + }; + }; + [_objInformant, ["HitPart", { (_this select 0) params ["_thisInformant", "_thisShooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"]; _hitLocation = _selection select 0; @@ -131,6 +143,7 @@ MISSION_fnc_CustomMission = { //This function is the main script for your missio _thisInformant setDamage 0.8; }; }; + _objInformant allowDamage false; }; }]] remoteExec ["addEventHandler", 0, true];