Advertisement
Guest User

NoGrenadeZoneTest001

a guest
Sep 19th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. if (!isServer) exitWith {};
  2. private ["_eh1","_inNoGrenadeZone","_noGrenadeZone","_dis"];
  3. _inNoGrenadeZone = false;
  4. _noGrenadeZone = getMarkerPos "noGrenadesArea001";
  5. _dis = 200;
  6.  
  7.  
  8.  
  9. if (alive player) then {
  10. if (_noGrenadeZone distance player > _dis) then {
  11. _inNoGrenadeZone = false;
  12. if (isPlayer player) then {
  13. systemChat format["You are no longer in the mission Area %1. You can now use Grenades.", (name player)];
  14. };
  15. }else{
  16. _inNoGrenadeZone = true;
  17. systemChat format["You have entered the Mission Zone %1. You cant use Hand Grenades here.", (name player)];
  18. _eh1 = player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];
  19. };
  20. };
  21.  
  22. while {true} do {
  23. if (alive player) then {
  24.  
  25. if ((_noGrenadeZone distance player < _dis) && (!_inNoGrenadeZone)) then {
  26. _eh1 = player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];
  27. _inNoGrenadeZone = true;
  28. if (isPlayer player) then {
  29. systemChat format["You have entered the Mission Zone %1. You cant use Hand Grenades here.", (name player)];
  30. };
  31. };
  32.  
  33. if ((_noGrenadeZone distance player > _dis) && (_inNoGrenadeZone)) then {
  34. player removeEventHandler ["fired", _eh1];
  35. _inNoGrenadeZone = false;
  36. if (isPlayer player) then {
  37. systemChat format["You are no longer in the mission Area %1. You can now use Grenades.", (name player)];
  38. };
  39. };
  40. };
  41.  
  42. sleep 1;
  43. };if (!isServer) exitWith {};
  44. private ["_eh1","_inNoGrenadeZone","_noGrenadeZone","_dis"];
  45. _inNoGrenadeZone = false;
  46. _noGrenadeZone = getMarkerPos "noGrenadesArea001";
  47. _dis = 200;
  48.  
  49.  
  50.  
  51. if (alive player) then {
  52. if (_noGrenadeZone distance player > _dis) then {
  53. _inNoGrenadeZone = false;
  54. if (isPlayer player) then {
  55. systemChat format["You are no longer in the mission Area %1. You can now use Grenades.", (name player)];
  56. };
  57. }else{
  58. _inNoGrenadeZone = true;
  59. systemChat format["You have entered the Mission Zone %1. You cant use Hand Grenades here.", (name player)];
  60. _eh1 = player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];
  61. };
  62. };
  63.  
  64. while {true} do {
  65. if (alive player) then {
  66.  
  67. if ((_noGrenadeZone distance player < _dis) && (!_inNoGrenadeZone)) then {
  68. _eh1 = player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];player addEventHandler ["fired", {deleteVehicle (_this select 6); titleText ["Firing/Grenades Disabled in a safe zone!", "PLAIN", 3]; titleFadeOut 1; }];
  69. _inNoGrenadeZone = true;
  70. if (isPlayer player) then {
  71. systemChat format["You have entered the Mission Zone %1. You cant use Hand Grenades here.", (name player)];
  72. };
  73. };
  74.  
  75. if ((_noGrenadeZone distance player > _dis) && (_inNoGrenadeZone)) then {
  76. player removeEventHandler ["fired", _eh1];
  77. _inNoGrenadeZone = false;
  78. if (isPlayer player) then {
  79. systemChat format["You are no longer in the mission Area %1. You can now use Grenades.", (name player)];
  80. };
  81. };
  82. };
  83.  
  84. sleep 1;
  85. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement