From 129fff019e2c692363a195aee5240b29901997a8 Mon Sep 17 00:00:00 2001 From: slb2k11 Date: Mon, 5 Oct 2015 18:55:40 +0200 Subject: [PATCH] Hotfix for Safezone --- ...nt_object_player_event_onEnterSafezone.sqf | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ExileClient_object_player_event_onEnterSafezone.sqf diff --git a/ExileClient_object_player_event_onEnterSafezone.sqf b/ExileClient_object_player_event_onEnterSafezone.sqf new file mode 100644 index 0000000..2c91005 --- /dev/null +++ b/ExileClient_object_player_event_onEnterSafezone.sqf @@ -0,0 +1,63 @@ +/** + * Exile Mod + * www.exilemod.com + * © 2015 Exile Mod Team + * + * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + */ + +private["_vehicle","_attachedObjects","_position", "_vehicles"]; + +if (ExilePlayerInSafezone) exitWith { false }; +ExilePlayerInSafezone = true; +if (alive player) then +{ + player allowDamage false; + player removeAllEventHandlers "HandleDamage"; +}; +_vehicle = vehicle player; +if !(_vehicle isEqualTo player) then +{ + if (local _vehicle) then + { + _vehicle allowDamage false; + }; + _attachedObjects = attachedObjects _vehicle; + if !(_attachedObjects isEqualTo []) then + { + _position = getPosATL _vehicle; + { + if ((_x isKindOf "PipeBombBase")) then + { + detach _x; + _x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05]; + _x setDir (random 260); + }; + } + forEach _attachedObjects; + }; + ExileClientSafeZoneVehicle = _vehicle; + ExileClientSafeZoneVehicleFiredEventHandler = _vehicle addEventHandler ["Fired", {_this call ExileClient_object_player_event_onFiredSafeZoneVehicle}]; +} +else +{ + _attachedObjects = attachedObjects _vehicle; + if !(_attachedObjects isEqualTo []) then + { + _position = getPosATL _vehicle; + { + if ((_x isKindOf "PipeBombBase")) then + { + detach _x; + _x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05]; + _x setDir (random 260); + }; + } + forEach _attachedObjects; + }; +}; +ExileClientSafeZoneESPEventHandler = addMissionEventHandler ["Draw3D", {20 call ExileClient_gui_safezone_safeESP}]; +["SafezoneEnter"] call ExileClient_gui_notification_event_addNotification; +ExileClientSafeZoneUpdateThreadHandle = [1, ExileClient_object_player_thread_safeZone, [], true] call ExileClient_system_thread_addtask; +true