Skip to content

function setPlayerMaxHealth

This function will set the player max health points for all players.
Original: setPlayerMaxHealth

Declaration

async def setPlayerMaxHealth(id : int, maxHealth : int)

Parameters

int id: the player id.
int maxHealth: max health points amount.

Source code in src/pyg2o/functions/player.py
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
async def setPlayerMaxHealth(id : int, maxHealth : int):
    """
    This function will set the player max health points for all players.
    Original: [setPlayerMaxHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/setPlayerMaxHealth/)

    ## Declaration
    ```python
    async def setPlayerMaxHealth(id : int, maxHealth : int)
    ```
    ## Parameters
    `int` **id**: the player id.
    `int` **maxHealth**: max health points amount.
    """
    data = f'return {get_call_repr()}'

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