mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
33 lines
972 B
Plaintext
33 lines
972 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: Dystopian
|
|
* Create actions for nearest vehicles with cargo.
|
|
*
|
|
* Arguments:
|
|
* 0: Target <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Child actions <ARRAY>
|
|
*
|
|
* Example:
|
|
* [cursorObject] call ace_cargo_fnc_addCargoVehiclesActions
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_target"];
|
|
|
|
private _statement = {
|
|
params ["_target", "_player", "_vehicle"];
|
|
[_player, _target, _vehicle] call FUNC(startLoadIn);
|
|
};
|
|
|
|
private _vehicles = (nearestObjects [_target, GVAR(cargoHolderTypes), (MAX_LOAD_DISTANCE + 10)]) select {
|
|
private _hasCargoConfig = 1 == getNumber (configOf _x >> QGVAR(hasCargo));
|
|
private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false];
|
|
(_hasCargoConfig || {_hasCargoPublic}) && {_x != _target} && {alive _x} && {locked _x < 2} &&
|
|
{([_target, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}
|
|
};
|
|
|
|
[_vehicles, _statement, _target] call EFUNC(interact_menu,createVehiclesActions)
|