Advertisement
aeroson

Arma 3: One time addAction cleanup

Nov 21st, 2014
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. /*
  2.  
  3. AUTHOR: aeroson
  4. NAME: onetimeCleanup.sqf
  5. VERSION: 2.0.1
  6.  
  7. DESCRIPTION:
  8. one call deletes stuff within radius from player that is not really needed:
  9. dead bodies, dropped items, smokes, chemlights, explosives
  10. beware: if weapons on ground is intentional e.g. fancy weapons stack, it will delete them too
  11. beware: if dead bodies are intentional it will delete them to
  12.  
  13. USAGE:
  14. put this into init of anything:
  15. this addAction ["Cleanup around you", "onetimeCleanup.sqf", [300]];
  16. where 300 is radius of cleanup, default is 1000
  17.  
  18. */
  19.  
  20.  
  21. private ["_start", "_args", "_radius"];
  22.  
  23. _start = diag_tickTime;
  24.  
  25. _args = _this;
  26. _args = [_args, 3, [], [[]]] call BIS_fnc_param;
  27. _radius = [_args, 0, 1000, [0]] call BIS_fnc_param;
  28.  
  29. {
  30. {
  31. deleteVehicle _x;
  32. } forEach ((getPos player) nearObjects [_x, _radius]);
  33. } forEach ["WeaponHolder","GroundWeaponHolder","WeaponHolderSimulated","TimeBombCore","SmokeShell"];
  34.  
  35.  
  36. {
  37. if(!alive _x) then {
  38. deleteVehicle _x;
  39. };
  40. } forEach ((getPos player) nearObjects ["Man", _radius]);
  41.  
  42.  
  43. hint format ["Cleanup took %1 seconds",diag_tickTime - _start];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement