aeroson

cleanup

Jun 2nd, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. /*
  2.  
  3. AUTHOR: aeroson
  4. NAME: cleanup
  5. VERSION: 1
  6.  
  7. DESCRIPTION:
  8. delete everything that is not really needed
  9. dead bodies, dropped items, smokes, chemlights, explosives, empty groups
  10.  
  11. */
  12.  
  13.  
  14. private ["_start","_obj","_canDelete"];
  15.  
  16. _start = diag_tickTime;
  17.  
  18. {
  19. deleteVehicle _x;
  20. } forEach allDead;
  21.  
  22.  
  23. {
  24. _canDelete = true;
  25. {
  26. if (alive _x) then {
  27. _canDelete = false;
  28. };
  29. } forEach units _x;
  30. if(_canDelete) then {
  31. deleteGroup _x;
  32. };
  33. } forEach allGroups;
  34.  
  35. {
  36. {
  37. deleteVehicle _x;
  38. } forEach ([10000, 10000] nearObjects [_x, 10000]);
  39. } forEach ["WeaponHolder","GroundWeaponHolder","WeaponHolderSimulated","TimeBombCore","SmokeShell"];
  40.  
  41. hint format ["Server cleanup took %1 seconds",diag_tickTime - _start];
Advertisement
Add Comment
Please, Sign In to add comment