ACE3/addons/common/functions/fnc_unloadPerson.sqf

33 lines
749 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>
*
* Public: No
2015-01-16 23:21:47 +00:00
*/
2015-05-25 18:38:28 +00:00
//#define DEBUG_MODE_FULL
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
private ["_vehicle","_emptyPos"];
2015-05-14 18:06:06 +00:00
PARAMS_1(_unit);
2015-01-16 23:21:47 +00:00
_vehicle = vehicle _unit;
if (_vehicle == _unit) exitwith {false;};
if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;};
_emptyPos = ((getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]);
if (count _emptyPos == 0) exitwith {false};
if (!isNull _vehicle) then {
[[_unit], QUOTE(FUNC(unloadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc);
2015-01-16 23:21:47 +00:00
};
true;