ACE3/addons/common/functions/fnc_unloadPerson.sqf

33 lines
624 B
Plaintext
Raw Normal View History

/*
* 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
*/
#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"];
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};
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