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
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-04-08 18:43:26 +00:00
|
|
|
#define GROUP_SWITCH_ID QFUNC(loadPerson)
|
2015-01-16 23:21:47 +00:00
|
|
|
|
2015-09-18 17:12:38 +00:00
|
|
|
params ["_unit"];
|
|
|
|
|
2015-12-14 12:08:19 +00:00
|
|
|
private _vehicle = vehicle _unit;
|
2015-01-16 23:21:47 +00:00
|
|
|
|
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
|
|
|
|
2015-05-25 16:43:29 +00:00
|
|
|
if (!isNull _vehicle) then {
|
2016-05-24 13:13:11 +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
|