summaryrefslogtreecommitdiffstats
path: root/Server/Functions/Server_HandleEmptyVehicle.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_HandleEmptyVehicle.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_HandleEmptyVehicle.sqf36
1 files changed, 36 insertions, 0 deletions
diff --git a/Server/Functions/Server_HandleEmptyVehicle.sqf b/Server/Functions/Server_HandleEmptyVehicle.sqf
new file mode 100644
index 0000000..29307a8
--- /dev/null
+++ b/Server/Functions/Server_HandleEmptyVehicle.sqf
@@ -0,0 +1,36 @@
+Private ['_abtimer','_exit','_skip','_timer','_trash','_vehicle'];
+
+_vehicle = _this;
+
+_exit = false;
+_timer = 0;
+_abtimer = ('WFBE_ABANDONVEHICLETIMER' Call GetNamespace);
+
+while {!_exit} do {
+ sleep 20;
+ _skip = false;
+ if (!(alive _vehicle) && !(isNull _vehicle)) then {
+ _skip = true;
+ _exit = true;
+ if !(_vehicle in trashQueu) then {
+ trashQueu = trashQueu + [_vehicle];
+ _vehicle Spawn TrashObject;
+ };
+ };
+ if (!(isNull _vehicle) && !_skip) then {
+ if (({alive _x} count (crew _vehicle)) > 0) then {_timer = 0};
+ if (_timer > _abtimer) then {
+ _exit = true;
+ if (someAmmo _vehicle) then {_vehicle setVehicleAmmo 0};
+ _vehicle setDammage 1;
+ sleep 2;
+ if !(_vehicle in trashQueu) then {
+ trashQueu = trashQueu + [_vehicle];
+ (_vehicle) Spawn TrashObject;
+ };
+ };
+ _timer = _timer + 20;
+ } else {_exit = true};
+};
+
+emptyQueu = emptyQueu - [_vehicle]; \ No newline at end of file