mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
32 lines
722 B
Plaintext
32 lines
722 B
Plaintext
/*
|
|
* Author: Glowbal
|
|
* Get nearest vehicle, priority car, air, tank, ship
|
|
*
|
|
* Arguments:
|
|
* 0: Object <OBJECT>
|
|
*
|
|
* Return value:
|
|
* Can load <BOOL>
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
private ["_vehicle"];
|
|
params ["_unit"];
|
|
|
|
_vehicle = nearestObject [_unit, "car"];
|
|
if (_unit distance _vehicle <= MAX_LOAD_DISTANCE) exitwith {_vehicle};
|
|
|
|
_loadhelicopter = nearestObject [_unit, "air"];
|
|
if (_unit distance _vehicle <= MAX_LOAD_DISTANCE) exitwith {_vehicle};
|
|
|
|
_loadtank = nearestObject [_unit, "tank"];
|
|
if (_unit distance _vehicle <= MAX_LOAD_DISTANCE) exitwith {_vehicle};
|
|
|
|
_loadtank = nearestObject [_unit, "ship"];
|
|
if (_unit distance _vehicle <= MAX_LOAD_DISTANCE) exitwith {_vehicle};
|
|
|
|
objNull;
|