summaryrefslogtreecommitdiffstats
path: root/Server/Functions/Server_HandleEmptyVehicle.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Server/Functions/Server_HandleEmptyVehicle.sqf
downloada2wf_chernarus-main.tar.gz
a2wf_chernarus-main.tar.bz2
a2wf_chernarus-main.zip
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