Skip to content

function getPlayerInstance

This function will get the player instance.
Original: getPlayerInstance

Declaration

async def getPlayerInstance(id : int) -> str

Parameters

int id: the player id.

Returns

str: the player instance.

Source code in src/pyg2o/functions/player.py
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
async def getPlayerInstance(id : int) -> str:
    """
    This function will get the player instance.
    Original: [getPlayerInstance](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/getPlayerInstance/)

    ## Declaration
    ```python
    async def getPlayerInstance(id : int) -> str
    ```
    ## Parameters
    `int` **id**: the player id.
    ## Returns
    `str`: the player instance.
    """
    data = f'return {get_call_repr()}'

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