2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-04-30 18:44:43 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Unload a person from a vehicle
|
2015-01-16 23:21:47 +00:00
|
|
|
*
|
2015-04-30 18:44:43 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Returns true if succesfully unloaded person <BOOL>
|
|
|
|
*
|
2016-01-27 00:01:01 +00:00
|
|
|
* Example:
|
|
|
|
* [hurtGuy] call ace_common_fnc_unloadPerson
|
|
|
|
*
|
2015-04-30 18:44:43 +00:00
|
|
|
* Public: No
|
2015-01-16 23:21:47 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-18 17:12:38 +00:00
|
|
|
params ["_unit"];
|
2019-09-05 20:56:53 +00:00
|
|
|
TRACE_1("unloadPerson",_unit);
|
2015-09-18 17:12:38 +00:00
|
|
|
|
2015-12-14 12:08:19 +00:00
|
|
|
private _vehicle = vehicle _unit;
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2019-09-05 20:56:53 +00:00
|
|
|
if (isNull _vehicle) exitWith {false};
|
2015-09-18 17:12:38 +00:00
|
|
|
if (_vehicle == _unit) exitWith {false};
|
|
|
|
|
2016-01-27 00:01:01 +00:00
|
|
|
if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 2}) exitWith {false};
|
2015-05-25 17:32:52 +00:00
|
|
|
|
2019-09-05 20:56:53 +00:00
|
|
|
["ace_unloadPersonEvent", [_unit, _vehicle], [_unit]] call CBA_fnc_targetEvent;
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2015-09-18 17:12:38 +00:00
|
|
|
true
|