ACE3/addons/common/functions/fnc_isPlayer.sqf

23 lines
666 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
2015-06-08 10:09:49 +00:00
* Author: bux578, commy2, akalegman
* Checks if a unit is a player / curator controlled unit.
* This now includes both local and non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
2015-09-18 19:12:40 +00:00
* 0: unit to be checked <OBJECT>
* 1: exclude remote controlled units <BOOL>
*
* Return Value:
2015-09-18 19:12:40 +00:00
* Is unit a player? <BOOL>
*
* Example:
* [cursorTarget, false] call ace_common_fnc_isPlayer;
*
2015-09-18 19:12:40 +00:00
* Public: Yes
*/
2015-09-18 19:12:40 +00:00
params ["_unit", ["_excludeRemoteControlled", false]];
2015-06-08 10:09:49 +00:00
(isPlayer _unit) || {(!_excludeRemoteControlled) && {!isNull (_unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull])}}