From b06990293397d4b6d0374097f09d1cc5679216e3 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:04 +0300 Subject: init --- Server/Functions/Server_TrashObject.sqf | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Server/Functions/Server_TrashObject.sqf (limited to 'Server/Functions/Server_TrashObject.sqf') diff --git a/Server/Functions/Server_TrashObject.sqf b/Server/Functions/Server_TrashObject.sqf new file mode 100644 index 0000000..bb983f1 --- /dev/null +++ b/Server/Functions/Server_TrashObject.sqf @@ -0,0 +1,34 @@ +/* + Author: Benny + Name: Server_TrashObject.sqf + Parameters: + 0 - Object + Description: + This function will remove an object after the defined amount of time. +*/ + +private ["_alive","_group","_isMan","_object","_get"]; +_object = _this; + +if !(isNull _object) then { + _group = []; + _isMan = if (_object isKindOf "Man") then {true} else {false}; + + if (_isMan) then {_group = group _object}; + + sleep ('WFBE_UNITREMOVEDLAY' Call GetNamespace); + trashQueu = trashQueu - [_object]; + + if (_isMan) then {hideBody _object; sleep 6}; + + deleteVehicle _object; + + if (_isMan) then { + if !(isNull _group) then { + _get = _group getVariable 'queue'; + if (isNil '_get') then { + if (count (units _group) <= 0) then {deleteGroup _group;}; + }; + }; + }; +}; \ No newline at end of file -- cgit v1.3.1