ACE3/addons/towing/functions/fnc_addRopeToVehicle.sqf
BrettMayson 1e404cf85b
General - SQF Improvements (#9698)
Co-authored-by: Dystopian <sddex@ya.ru>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-02-04 14:50:24 -03:00

28 lines
586 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Dystopian
* Adds rope to vehicle inventory.
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* Return Value:
* None
*
* Example:
* cursorObject call ace_towing_fnc_addRopeToVehicle
*
* Public: No
*/
if (!GVAR(addRopeToVehicleInventory)) exitWith {};
params ["_vehicle"];
if (0 == getNumber (configOf _vehicle >> QEGVAR(cargo,hasCargo))) exitWith {};
private _ropeType = ["ACE_rope6", "ACE_rope12"] select (
-1 < ["Tank", "Wheeled_APC_F", "Truck_F"] findIf {_vehicle isKindOf _x}
);
_vehicle addItemCargoGlobal [_ropeType, 1];