Advertisement
skotracker

ExileClient_object_player_event_onEnterSafezone

Apr 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.91 KB | None | 0 0
  1. /**
  2.  * Exile Mod
  3.  * www.exilemod.com
  4.  * © 2015 Exile Mod Team
  5.  *
  6.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  7.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  8.  */
  9.  
  10. private["_vehicle","_attachedObjects","_position", "_vehicles"];
  11.  
  12. if (ExilePlayerInSafezone) exitWith { false };
  13. ExilePlayerInSafezone = true;
  14. if (alive player) then
  15. {
  16.     player allowDamage false;
  17.     player removeAllEventHandlers "HandleDamage";
  18. };
  19. _vehicle = vehicle player;
  20. if !(_vehicle isEqualTo player) then
  21. {
  22.     if (local _vehicle) then
  23.     {
  24.         _vehicle allowDamage false;
  25.     };
  26.     _attachedObjects = attachedObjects _vehicle;
  27.     if !(_attachedObjects isEqualTo []) then
  28.     {
  29.         _position = getPosATL _vehicle;
  30.         {
  31.             if ((_x isKindOf "PipeBombBase")) then
  32.             {
  33.                 detach _x;
  34.                 _x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
  35.                 _x setDir (random 260);
  36.             };
  37.         }
  38.         forEach _attachedObjects;
  39.     };
  40.     ExileClientSafeZoneVehicle = _vehicle;
  41.     ExileClientSafeZoneVehicleFiredEventHandler = _vehicle addEventHandler ["Fired", {_this call ExileClient_object_player_event_onFiredSafeZoneVehicle}];
  42. }
  43. else
  44. {
  45.     _attachedObjects = attachedObjects _vehicle;
  46.     if !(_attachedObjects isEqualTo []) then
  47.     {
  48.         _position = getPosATL _vehicle;
  49.         {
  50.             if ((_x isKindOf "PipeBombBase")) then
  51.             {
  52.                 detach _x;
  53.                 _x setPosATL [(_position select 0) + random 2, (_position select 1) + random 2, 0.05];
  54.                 _x setDir (random 260);
  55.             };
  56.         }
  57.         forEach _attachedObjects;
  58.     };
  59. };
  60. ExileClientSafeZoneESPEventHandler = addMissionEventHandler ["Draw3D", {20 call ExileClient_gui_safezone_safeESP}];
  61. ["SafezoneEnter"] call ExileClient_gui_notification_event_addNotification;
  62. ExileClientSafeZoneUpdateThreadHandle = [1, ExileClient_object_player_thread_safeZone, [], true] call ExileClient_system_thread_addtask;
  63. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement