Author: davidoss
Author Website:

Requirements: No addons required

Version: 1.3.1

Short description: This script deletes all in game dropped gear, dead bodies, damaged vehicles without crew, wrecks and ruins in MP/SP.

Date: 2018-01-16 19:36


Comments: (0)
Rating:



 





CleanUp script

by
davidoss


Description:
This script deletes all in game dropped gear, dead bodies, damaged vehicles without crew, wrecks and ruins in MP/SP.
Can be used for whole map area or for zones, using markers or triggers (trigger type "NONE") with defined area.


Installation / Usage:
Place the script in mission root/scripts directory.

Function parameter:
String, an area marker.
or
Object an trigger with area.

Usage is also commented at the top of the file.
Best method is to compile it into a function.

fnc_cleanup = compileFinal preprocessFileLineNumbers "scripts\cleanup.sqf";
["markername"] call fnc_cleanup;
//or
[triggername] call fnc_cleanup;

//or for whole map
[] call fnc_cleanup;
You can also set a loop:
init.sqf:
if (isServer) then {

fnc_cleanup = compileFinal preprocessFileLineNumbers "scripts\cleanup.sqf";

    [] spawn {

        while {true} do {        
            
            [triggername] call fnc_cleanup;
            
            //You can also use markers name instead or multiple markers/triggers
            
            ["markername"] call fnc_cleanup;

        sleep 500;
        };
    };
};
Or from other script:
if (isServer) then {
fnc_cleanup = compileFinal preprocessFileLineNumbers "scripts\cleanup.sqf";

_claenMarker = createMarker ["claenmarker",[4000,4000]];
_claenMarker setMarkerSize [500, 500];
_claenMarker setMarkerShape "RECTANGLE";
_claenMarker setMarkerType "Empty";
_claenMarker setMarkerAlpha 0;

    [_claenMarker] spawn {
    params ["_marker"];
        while {true} do {        
            
            [_marker] call fnc_cleanup;
            

        sleep 500;
        };
    };
};

To prevent remove of certain objects put in object init:
this setVariable ["dnt_remove_me",true,false];


Known issues:
None knew for now.


License / Disclaimer:
You are allowed to change what you want in this script.


Changelog:
1.3.1
fixed: released function instead script

1.3
Changed usage to more user friendly way see first post
Added player in area check

v1.2 Final
*Changed usage of BIS_fnc_inTrigger to inAreaArray command
*Set lazy evaluation for conditions

v1.1 Final
* Set persistence for certain object.

v1.0 Final
* Possibility to adjust functionality.
* You can now define objects to delete and define damage threshold for vehicles.
* removing empty groups

12/25/15
First release.


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Script,   Delete,   Remove,   Objects,   Dead Body,   Damage,   Wrecks