diff options
| author | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
|---|---|---|
| committer | hybrid <hybrid@hybridlabs.pro> | 2026-06-11 19:54:45 +0300 |
| commit | 68d4c9bbd80ed2e6528244569c79676b87295bd1 (patch) | |
| tree | 6efd42fbf6f1281874ae0ff1f8816b01fe0c7153 /Server/Functions/Server_HandleEmptyVehicle.sqf | |
| download | a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.gz a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.tar.bz2 a2wf_takistan-68d4c9bbd80ed2e6528244569c79676b87295bd1.zip | |
init
Diffstat (limited to 'Server/Functions/Server_HandleEmptyVehicle.sqf')
| -rw-r--r-- | Server/Functions/Server_HandleEmptyVehicle.sqf | 36 |
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 |
