Skip to content

function getPlayerHealth

This function will get the player health points.
Original: getPlayerHealth

Declaration

async def getPlayerHealth(id : int) -> int

Parameters

int id: the player id.

Returns

int: the health points amount.

Source code in src/pyg2o/functions/player.py
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
async def getPlayerHealth(id : int) -> int:
    """
    This function will get the player health points.
    Original: [getPlayerHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/getPlayerHealth/)

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

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