ACE3/addons/common/functions/fnc_unloadPerson.sqf

33 lines
632 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"
#define GROUP_SWITCH_ID QUOTE(FUNC(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-01-27 00:01:01 +00:00
["unloadPersonEvent", [_unit], [_unit, _vehicle]] call EFUNC(common,targetEvent);
2015-01-16 23:21:47 +00:00
};
2015-09-18 17:12:38 +00:00
true