Skip to content

function getPlayerSerial

Note

The function can return null if player isn't connected.

Note

For some players (e.g: that are playing on linux using WINE) this function might return empty string.

This function will get the player serial.
Serial is used to uniquely idientify each player.
Original: getPlayerSerial

Declaration

async def getPlayerSerial(id : int) -> str

Parameters

int id: the player id.

Returns

str: the player serial.

Source code in src/pyg2o/functions/player.py
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
async def getPlayerSerial(id : int) -> str:
    """
    !!! note
        The function can return `null` if player isn't connected.
    !!! note
        For some players (e.g: that are playing on linux using WINE) this function might return empty string.
    This function will get the player serial.
    Serial is used to uniquely idientify each player.
    Original: [getPlayerSerial](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/getPlayerSerial/)

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

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