fn_getNearbyPlayers
This commit is contained in:
parent
b70e3505d5
commit
d4088ae9e5
|
@ -2,19 +2,23 @@
|
|||
File: fn_getNearbyPlayers.sqf
|
||||
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
|
||||
Date: 2019-11-25
|
||||
Last Update: 2019-11-25
|
||||
Last Update: 2019-12-05
|
||||
License: MIT License - http://www.opensource.org/licenses/MIT
|
||||
|
||||
Description:
|
||||
No description added yet.
|
||||
Gets all alive players inside given radius to given position.
|
||||
|
||||
Parameter(s):
|
||||
_localVariable - Description [DATATYPE, defaults to DEFAULTVALUE]
|
||||
_pos - Center position to search from [POSITION, defaults to [0, 0, 0]]
|
||||
_radius - Radius from center position to search from [NUMBER, defaults to 100]
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
Nearby alive players [ARRAY]
|
||||
*/
|
||||
// TODO
|
||||
params [ "_searchposition", "_distance"];
|
||||
|
||||
allPlayers select {alive _x && _x distance _searchposition < _distance}
|
||||
params [
|
||||
["_pos", [0, 0, 0], [[2, 3]]],
|
||||
["_radius", 100, [0]]
|
||||
];
|
||||
|
||||
allPlayers select {alive _x && {(_x distance2d _pos) < _radius}}
|
||||
|
|
Loading…
Reference in New Issue