ACE3/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf

33 lines
732 B
Plaintext
Raw Normal View History

2015-02-04 05:13:44 +00:00
/*
* Author: PabstMirror
* Loads a captive into a vehicle
*
* Arguments:
* 0: The Captive <OBJECT>
* 1: The Vehicle <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
2015-02-06 23:03:56 +00:00
* [bob, car1] call ACE_captives_fnc_vehicleCaptiveMoveIn;
2015-02-04 05:13:44 +00:00
*
* Public: No
*/
#include "script_component.hpp"
params ["_target","_vehicle"];
2015-08-23 17:32:46 +00:00
TRACE_2("params",_target,_vehicle);
2015-08-23 17:32:46 +00:00
private ["_cargoIndex"];
2015-08-20 09:20:46 +00:00
2015-08-23 17:32:46 +00:00
_getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
TRACE_1("free cargo seat",_getSeat);
_cargoIndex = _getSeat select 0;
if (_cargoIndex == -1) exitWith {ERROR("cargo index -1");};
2015-08-15 02:29:01 +00:00
2015-08-23 17:32:46 +00:00
_target moveInCargo [_vehicle, _cargoIndex];
_target assignAsCargoIndex [_vehicle, _cargoIndex];
2015-08-20 09:20:46 +00:00
2015-02-06 09:38:27 +00:00
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true];