Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. /*
  2. GrenadeStop v0.8 for ArmA 3 Alpha by Bake
  3.  
  4. DESCRIPTION:
  5. Stops players from throwing grenades in safety zones.
  6.  
  7. INSTALLATION:
  8. Move grenadeStop.sqf to your mission's folder. Then add the
  9. following line to your init.sqf file (create one if necessary):
  10. execVM "grenadeStop.sqf";
  11.  
  12. CONFIGURATION:
  13. Edit the #defines below.
  14. */
  15.  
  16. #define SAFETY_ZONES [["respawn_east", 300]] // Syntax: [["marker1", radius1], ["marker2", radius2], ...]
  17. #define MESSAGE "Do not throw grenades inside the base!\nPress I instead of G to" +\
  18. " open your inventory.\nRebind the throw key to avoid accidents."
  19.  
  20. if (isDedicated) exitWith {};
  21. waitUntil {!isNull player};
  22.  
  23. player addEventHandler ["Fired", {
  24. if (_this select 2 == "HandGrenadeMuzzle") then
  25. {
  26. // Lazy evaluation now supported by default? Curly brackets not working.
  27.  
  28. if ({(_this select 0) distance getMarkerPos (_x select 0) < _x select 1} count SAFETY_ZONES > 0) then
  29. {
  30. deleteVehicle (_this select 6);
  31. titleText [MESSAGE, "PLAIN", 3];
  32. };
  33. };
  34. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement