Skip to content

function setPlayerWorld

This function will set the player world for all players.
Original: setPlayerWorld

Declaration

async def setPlayerWorld(id : int, world : str, startPointName : str)

Parameters

int id: the player id.
str world: the path to the target world (.ZEN). World path is relative to directory _Work/Data/Worlds.
str startPointName: the name of the vob to which the player will be moved. If passed empty string, player will be placed at world start point. If vob with specified name doesn't exists or world doesn't have start point, player will be placed at {0, 150, 0} coordinates.

Source code in src/pyg2o/functions/player.py
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
async def setPlayerWorld(id : int, world : str, startPointName : str = ""):
    """
    This function will set the player world for all players.
    Original: [setPlayerWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/setPlayerWorld/)

    ## Declaration
    ```python
    async def setPlayerWorld(id : int, world : str, startPointName : str)
    ```
    ## Parameters
    `int` **id**: the player id.
    `str` **world**: the path to the target world (.ZEN). World path is relative to directory `_Work/Data/Worlds`.
    `str` **startPointName**: the name of the vob to which the player will be moved. If passed empty string, player will be placed at world start point. If vob with specified name doesn't exists or world doesn't have start point, player will be placed at {0, 150, 0} coordinates.
    """
    data = f'return {get_call_repr()}'

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