fn_getNearbyPlayers

This commit is contained in:
Wyqer 2019-12-05 22:43:04 +01:00
parent b70e3505d5
commit d4088ae9e5
No known key found for this signature in database
GPG Key ID: D7E2F8BD7F1E48FA
1 changed files with 11 additions and 7 deletions

View File

@ -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}}