ACE3/addons/common/functions/fnc_unloadPerson.sqf

31 lines
618 B
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
/*
* Author: Glowbal
* Unload a person from a vehicle
2015-01-16 23:21:47 +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
*
* Public: No
2015-01-16 23:21:47 +00:00
*/
2015-09-18 17:12:38 +00:00
params ["_unit"];
TRACE_1("unloadPerson",_unit);
2015-09-18 17:12:38 +00:00
private _vehicle = vehicle _unit;
2015-01-16 23:21:47 +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};
["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