mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Regex used: \[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\) [$1,$3,$2] call CBA_fnc_targetEvent E?FUNC\((common,)?(server|global|local)Event\) CBA_fnc_$2Event E?FUNC\((common,)?(add|remove)EventHandler\) CBA_fnc_$2EventHandler
33 lines
626 B
Plaintext
33 lines
626 B
Plaintext
/*
|
|
* Author: Glowbal
|
|
* Unload a person from a vehicle
|
|
*
|
|
* Arguments:
|
|
* 0: unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Returns true if succesfully unloaded person <BOOL>
|
|
*
|
|
* Example:
|
|
* [hurtGuy] call ace_common_fnc_unloadPerson
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson))
|
|
|
|
params ["_unit"];
|
|
|
|
private _vehicle = vehicle _unit;
|
|
|
|
if (_vehicle == _unit) exitWith {false};
|
|
|
|
if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 2}) exitWith {false};
|
|
|
|
if (!isNull _vehicle) then {
|
|
["unloadPersonEvent", [_unit, _vehicle], [_unit]] call CBA_fnc_targetEvent;
|
|
};
|
|
|
|
true
|