Skip to content

function findNearbyPlayers

This function will search for nearest players, that matches given query arguments.
Original: findNearbyPlayers

Declaration

async def findNearbyPlayers(position : dict, radius : int, world : str, virtual_world : int = 0) -> list

Parameters

dict {x, y, z} position: the centroid position.
int radius: the maximum radius to search from centroid.
str world: the world used to find players.
int virtual_world: the virtual world used to find players.

Returns

list [int]: ids of nearby players.

Source code in src/pyg2o/functions/streamer.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
async def findNearbyPlayers(position : dict, radius : int, world : str, virtual_world : int = 0) -> list:
    """
    This function will search for nearest players, that matches given query arguments.
    Original: [findNearbyPlayers](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/streamer/findNearbyPlayers/)

    ## Declaration
    ```python
    async def findNearbyPlayers(position : dict, radius : int, world : str, virtual_world : int = 0) -> list
    ```
    ## Parameters
    `dict {x, y, z}` **position**: the centroid position.
    `int` **radius**: the maximum radius to search from centroid.
    `str` **world**: the world used to find players.
    `int` **virtual_world**: the virtual world used to find players.
    ## Returns
    `list [int]`: ids of nearby players.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result