summaryrefslogtreecommitdiffstats
path: root/Server/Functions/Server_TrashObject.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:57:23 +0300
commit3533c3aa9393fc6350178b196c813dc636ec9cf6 (patch)
tree2f96a879c3935dea18e73410926b03c7eef1a751 /Server/Functions/Server_TrashObject.sqf
downloada2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.gz
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.tar.bz2
a2wf_isladuala-3533c3aa9393fc6350178b196c813dc636ec9cf6.zip
init
Diffstat (limited to '')
-rw-r--r--Server/Functions/Server_TrashObject.sqf34
1 files changed, 34 insertions, 0 deletions
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