Skip to content

function setPlayerColor

This function will set the player nickname color for all players.
Original: setPlayerColor

Declaration

async def setPlayerColor(id : int, r : int, g : int, b : int)

Parameters

int id: the player id.
int r: the red color component in RGB model.
int g: the green color component in RGB model.
int b: the blue color component in RGB model.

Source code in src/pyg2o/functions/player.py
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
async def setPlayerColor(id : int, r : int, g : int, b : int):
    """
    This function will set the player nickname color for all players.
    Original: [setPlayerColor](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/setPlayerColor/)

    ## Declaration
    ```python
    async def setPlayerColor(id : int, r : int, g : int, b : int)
    ```
    ## Parameters
    `int` **id**: the player id.
    `int` **r**: the red color component in RGB model.
    `int` **g**: the green color component in RGB model.
    `int` **b**: the blue color component in RGB model.
    """
    data = f'return {get_call_repr()}'

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