Skip to content

function isPlayerSpawned

The function is used to check whether player is spawned.
Original: isPlayerSpawned

Declaration

async def isPlayerSpawned(id : int) -> bool

Parameters

int id: the player id.

Returns

bool: true when player is spawned, otherwise false.

Source code in src/pyg2o/functions/player.py
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
async def isPlayerSpawned(id : int) -> bool:
    """
    The function is used to check whether player is spawned.
    Original: [isPlayerSpawned](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/isPlayerSpawned/)

    ## Declaration
    ```python
    async def isPlayerSpawned(id : int) -> bool
    ```
    ## Parameters
    `int` **id**: the player id.
    ## Returns
    `bool`: `true` when player is spawned, otherwise `false`.
    """
    data = f'return {get_call_repr()}'

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