ACE3/addons/switchunits/functions/fnc_nearestPlayers.sqf

22 lines
497 B
Plaintext
Raw Permalink Normal View History

#include "..\script_component.hpp"
/*
2015-02-02 22:28:27 +00:00
* Author: bux578
* Returns an array of alive players in a given radius around a given location
*
* Arguments:
* 0: Center position <POSTION>
* 1: Radius <NUMBER>
*
* Return Value:
* Player units <ARRAY<OBJECT>>
*
* Example:
2015-08-07 07:18:42 +00:00
* [[300,300,0], 100] call ace_switchunits_fnc_nearestPlayers
2015-02-02 22:28:27 +00:00
*
* Public: Yes
*/
2015-01-12 14:47:22 +00:00
2015-08-07 07:18:42 +00:00
params ["_position", "_radius"];
(nearestObjects [_position, ["Man"], _radius]) select {alive _x && {[_x] call EFUNC(common,isPlayer)}};