Advertisement
Brenner650

ExileClient_object_player_thread_safeZone.sqf

Dec 24th, 2019
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. /**
  2. * ExileClient_object_player_thread_safeZone
  3. *
  4. * Exile Mod
  5. * www.exilemod.com
  6. * © 2015 Exile Mod Team
  7. *
  8. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10. */
  11. /***** JakeHekesFists Edit: 2017 *****/
  12.  
  13. private _vehicle = vehicle player;
  14.  
  15. // use these settings to toggle features on and off
  16. private _disableUAV = true; // disables player from connecting UAV to terminal in safe zone
  17. private _disableBikes = false; // ejects players from bicycles in safe zone to prevent crazy bicycle ramming - players can still pack bike if using enigma script.
  18.  
  19. if (!ExilePlayerInSafezone) exitWith {false};
  20.  
  21. if (_disableUAV) then {
  22. if (alive (getConnectedUAV player)) then {
  23. player connectTerminalToUAV objNull;
  24. ["ErrorTitleAndText", ["Warning!", "Do not operate the UAV from inside the Safe Zone"]] call ExileClient_gui_toaster_addTemplateToast;
  25. };
  26. };
  27.  
  28. if (_vehicle isEqualTo player) then {
  29. if !(isNull ExileClientSafeZoneVehicle) then {
  30. ExileClientSafeZoneVehicle removeEventHandler ["Fired", ExileClientSafeZoneVehicleFiredEventHandler];
  31. ExileClientSafeZoneVehicle = objNull;
  32. ExileClientSafeZoneVehicleFiredEventHandler = nil;
  33. };
  34. } else {
  35. if (local _vehicle) then { _vehicle allowDamage false; };
  36.  
  37. if (_disableBikes) then {
  38. if (_vehicle isKindOf "Bicycle") then {
  39. player setVelocity [0, 0, 0];
  40. player action [ "eject", _vehicle ];
  41. ["ErrorTitleAndText", ["OFF YA BIKE M8", "Bicycles are not allowed in the SafeZone"]] call ExileClient_gui_toaster_addTemplateToast;
  42. };
  43. };
  44.  
  45. if !(_vehicle isEqualTo ExileClientSafeZoneVehicle) then {
  46. if !(isNull ExileClientSafeZoneVehicle) then {
  47. ExileClientSafeZoneVehicle removeEventHandler ["Fired", ExileClientSafeZoneVehicleFiredEventHandler];
  48. ExileClientSafeZoneVehicle = objNull;
  49. ExileClientSafeZoneVehicleFiredEventHandler = nil;
  50. };
  51. ExileClientSafeZoneVehicle = _vehicle;
  52. ExileClientSafeZoneVehicleFiredEventHandler = _vehicle addEventHandler ["Fired", {_this call ExileClient_object_player_event_onFiredSafeZoneVehicle}];
  53. };
  54. };
  55. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement