Skip to content

function giveItem

This function is used to give item for player.
Original: giveItem

Declaration

async def giveItem(id : int, instance : str, amount : int)

Parameters

int id: the player id.
str instance: the item instance from Daedalus scripts.
int amount: the amount of item, e.g: 1000 gold coins.

Source code in src/pyg2o/functions/player.py
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
async def giveItem(id : int, instance : str, amount : int):
    """
    This function is used to give item for player.
    Original: [giveItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/giveItem/)

    ## Declaration
    ```python
    async def giveItem(id : int, instance : str, amount : int)
    ```
    ## Parameters
    `int` **id**: the player id.
    `str` **instance**: the item instance from Daedalus scripts.
    `int` **amount**: the amount of item, e.g: `1000` gold coins.
    """
    data = f'return {get_call_repr()}'

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