Skip to content

function getNpcHostPlayer

This function gets NPC host player id.
Original: getNpcHostPlayer

Declaration

async def getNpcHostPlayer(npc_id : int) -> int

Parameters

int npc_id: the identifier of npc.

Returns

int: the host player identifier. If there is no host player -1 is returned instead.

Source code in src/pyg2o/functions/npc.py
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
async def getNpcHostPlayer(npc_id : int) -> int:
    """
    This function gets NPC host player id.
    Original: [getNpcHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/npc/getNpcHostPlayer/)

    ## Declaration
    ```python
    async def getNpcHostPlayer(npc_id : int) -> int
    ```
    ## Parameters
    `int` **npc_id**: the identifier of npc.
    ## Returns
    `int`: the host player identifier. If there is no host player `-1` is returned instead.
    """
    data = f'return {get_call_repr()}'

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