Guest User

Untitled

a guest
Jan 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. clean_nullobj = {
  2. diag_log ("DW_DEBUG: dw_clean_nullobj FNC starts correctly!!! ");
  3. _countNullObj = 0;
  4. _countNullObjDeleted = 0;
  5.  
  6. try
  7. {
  8. {
  9. if(isNull _x) then
  10. {
  11. _countNullObj = _countNullObj + 1;
  12.  
  13. if (_countNullObj > 32) then
  14. {
  15. _myGroupX = group _x;
  16. _x removeAllMPEventHandlers "mpkilled";
  17. _x removeAllMPEventHandlers "mphit";
  18. _x removeAllMPEventHandlers "mprespawn";
  19.  
  20. _x removeAllEventHandlers "FiredNear";
  21. _x removeAllEventHandlers "HandleDamage";
  22. _x removeAllEventHandlers "Killed";
  23. _x removeAllEventHandlers "Fired";
  24. _x removeAllEventHandlers "GetOut";
  25. _x removeAllEventHandlers "Local";
  26.  
  27. clearVehicleInit _x; //let's clear all PICs
  28. deleteVehicle _x;
  29. deleteGroup _myGroupX;
  30. _countNullObjDeleted = _countNullObjDeleted+1;
  31. _x = nil; //this seems clean even more :) thx Tansien
  32. };
  33. };
  34. } forEach allMissionObjects "all";
  35. }
  36. catch
  37. {
  38. diag_log("DEBUGLOG: EXCEPTION: clean_nullobj: " + _exception);
  39. };
  40.  
  41. diag_log ("DEBUG: clean_nullobj FNC ends correctly!!! found _countNullObj: " + str(_countNullObj) + " _countNullObjDeleted: " + str(_countNullObjDeleted) );
  42. };
Add Comment
Please, Sign In to add comment