Skip to content

function addEvent

This function will register a new event with specified name.
Events can be used to notify function(s) when something will happen, like player joins the server, etc.
Original: addEvent

Declaration

def addEvent(name)

Parameters

  • str name: the name of the event

Usage

import g2o

g2o.addEvent('testEvt')
Source code in src/pyg2o/functions/event.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
def addEvent(name : str):
    """
    This function will register a new event with specified name.
    Events can be used to notify function(s) when something will happen, like player joins the server, etc.
    Original: [addEvent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/event/addEvent/)

    ## Declaration
    ```python
    def addEvent(name)
    ```

    ## Parameters
    * `str` **name**: the name of the event

    ## Usage
    ```python
    import g2o

    g2o.addEvent('testEvt')
    ```
    """
    if name not in eventList:
        eventList[name] = []