ACE3/addons/cargo/functions/fnc_unloadAllVehicles.sqf
Vdauphin b9eb48c64d Overwrite BI unload all vehicles
Use ACE own interraction to unload all vehicles as BI action unload all vehicles do.
2020-11-06 22:16:13 +01:00

27 lines
718 B
Plaintext

#include "script_component.hpp"
/*
* Author: Vdauphin
* Unload all vehicles but not ACE Cargo.
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* Return Value:
* Loaded vehiclesnot part of ACE Cargo <ARRAY>
*
* Example:
* [vehicle player] call ace_cargo_fnc_unloadAllVehicles
*
* Public: No
*/
params ["_vehicle"];
private _loadedVehicles = getVehicleCargo _vehicle - (_vehicle getVariable [QGVAR(loaded), []]);
private _unloadingInterval = getNumber (configfile >> "CfgVehicles" >> typeOf _vehicle >> "VehicleTransport" >> "Carrier" >> "unloadingInterval");
{
[{objnull setVehicleCargo _this}, _x, _forEachIndex * _unloadingInterval] call CBA_fnc_waitAndExecute;
} forEach _loadedVehicles;
_loadedVehicles