Skip to content

function getPlayerCameraPosition

This function will get the player camera position in world.
Original: getPlayerCameraPosition

Declaration

getPlayerCameraPosition(id : int) -> Optional[tuple]

Parameters

int id: the player id.

Returns

tuple (x, y, z): the dictionary that represents camera position.

Source code in src/pyg2o/functions/player.py
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
async def getPlayerCameraPosition(id : int) -> Optional[tuple]:
    """
    This function will get the player camera position in world.
    Original: [getPlayerCameraPosition](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/getPlayerCameraPosition/)

    ## Declaration
    ```python
    getPlayerCameraPosition(id : int) -> Optional[tuple]
    ```
    ## Parameters
    `int` **id**: the player id.
    ## Returns
    `tuple (x, y, z)`: the dictionary that represents camera position.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return (result['x'], result['y'], result['z']) if result is not None else (None, None, None)