Skip to content

function setNpcHostPlayer

This function sets new NPC host player.
Original: setNpcHostPlayer

Declaration

async def setNpcHostPlayer(npc_id : int, host_id : int) -> bool

Parameters

int npc_id: the npc identifier.
int host_id: the player host identifier.

Returns

bool: true if host was successfully changed, otherwise false.

Source code in src/pyg2o/functions/npc.py
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
async def setNpcHostPlayer(npc_id : int, host_id : int) -> bool:
    """
    This function sets new NPC host player.
    Original: [setNpcHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/setNpcHostPlayer/)

    ## Declaration
    ```python
    async def setNpcHostPlayer(npc_id : int, host_id : int) -> bool
    ```
    ## Parameters
    `int` **npc_id**: the npc identifier.
    `int` **host_id**: the player host identifier.
    ## Returns
    `bool`: `true` if host was successfully changed, otherwise `false`.
    """
    data = f'return {get_call_repr()}'

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