mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-24 09:29:21 +03:00
Add toggleable Bury and Butcher Bodies by salival
This also re-arranges the configVariables.sqf and loads the variables for both (server and client) first. This allows to check for certain variables like Z_SingleCurrency and stops the loading of all other Z_SingleCurrency variables even when Z_SingleCurrency was not on.
This commit is contained in:
38
SQF/dayz_server/system/scheduler/sched_lootCrates.sqf
Normal file
38
SQF/dayz_server/system/scheduler/sched_lootCrates.sqf
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
// Delete loot crates, graves and crosses after 25 minutes
|
||||
sched_lootCrates = {
|
||||
private ["_delQtyCrate","_crateTime","_objects","_crates","_graves","_cross"];
|
||||
|
||||
_delQtyCrate = 0;
|
||||
#define CENTER getMarkerPos "center"
|
||||
#define RADIUS ((getMarkerSize "center") select 1)*2
|
||||
|
||||
_crates = CENTER nearObjects ["DZ_AmmoBoxSmallUS",RADIUS];
|
||||
_graves = CENTER nearObjects ["Grave",RADIUS];
|
||||
_cross = CENTER nearObjects ["GraveCross1",RADIUS];
|
||||
|
||||
_objects = _crates + _graves + _cross;
|
||||
|
||||
{
|
||||
if (_x getVariable ["bury",false]) then {
|
||||
_crateTime = _x getVariable ["sched_co_crateTime", -1];
|
||||
if (_crateTime == -1) exitWith {
|
||||
_crateTime = diag_tickTime;
|
||||
_x setVariable ["sched_co_crateTime", _crateTime];
|
||||
};
|
||||
if (diag_tickTime - _crateTime > 25*60) then {
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyCrate = _delQtyCrate + 1;
|
||||
};
|
||||
};
|
||||
} forEach _objects;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
if (_delQtyCrate> 0) then {
|
||||
diag_log format ["%1: Deleted %2 bury/butcher objects.",__FILE__,_delQtyCrate];
|
||||
};
|
||||
#endif
|
||||
|
||||
objNull
|
||||
};
|
||||
Reference in New Issue
Block a user