diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:53:22 +0300 |
| commit | c055d44dcdb87e8db49fb23e632fc086aa44cce6 (patch) | |
| tree | 7ac98d865915930bebc86b36b512a859c31538e5 /Server/Functions/Server_TrashObject.sqf | |
| download | a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.gz a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.tar.bz2 a2wf_zargabad-c055d44dcdb87e8db49fb23e632fc086aa44cce6.zip | |
init
Diffstat (limited to 'Server/Functions/Server_TrashObject.sqf')
| -rw-r--r-- | Server/Functions/Server_TrashObject.sqf | 34 |
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 |
