ACE3/addons/common/functions/fnc_isPlayer.sqf

22 lines
656 B
Plaintext
Raw Normal View History

/*
2015-06-08 10:09:49 +00:00
* Author: bux578, commy2, akalegman
*
* Checks if a unit is a player / curator controlled unit.
* Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
* 0: unit to be checked (object)
2015-06-08 18:12:16 +00:00
* 1: exclude remote controlled units (boolean)
*
* Return Value:
* Bool: is unit a player?
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-06-08 18:12:16 +00:00
private ["_unit", "_excludeRemoteControlled"];
2015-06-08 10:09:49 +00:00
2015-06-08 18:12:16 +00:00
_unit = _this select 0;
_excludeRemoteControlled = if (count _this > 1) then {_this select 1} else {false};
2015-06-08 10:09:49 +00:00
2015-06-08 18:12:16 +00:00
isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)})