docs: Added onPlayerUseCheat and NPC related events
This commit is contained in:
21
docs/defaultEvents/anticheat/onPlayerUseCheat.md
Normal file
21
docs/defaultEvents/anticheat/onPlayerUseCheat.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# `event` onPlayerUseCheat
|
||||||
|
!!! note
|
||||||
|
Detecting some type of forbidden tools may take, even a few minutes. Server need time to analyze player data.
|
||||||
|
|
||||||
|
This event is triggered when player uses some of forbidden cheat tools.
|
||||||
|
|
||||||
|
Original: [onPlayerUseCheat](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/anticheat/onPlayerUseCheat/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **playerid**: the id of the player who used some type of trainer/cheat.
|
||||||
|
* `int` **type**: the type of used trainer/cheat. For more information see [AntiCheat constants](../../constants/anticheat.md)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onPlayerUseCheat')
|
||||||
|
def onCheat(**kwargs):
|
||||||
|
print(f'Player {kwargs['playerid']} used forbidden cheat tool type {kwargs['type']}.')
|
||||||
|
```
|
||||||
21
docs/defaultEvents/npc/onNpcActionFinished.md
Normal file
21
docs/defaultEvents/npc/onNpcActionFinished.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# `event` onNpcActionFinished
|
||||||
|
|
||||||
|
This event is triggered when NPC action was finished.
|
||||||
|
|
||||||
|
Original: [onNpcActionFinished](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcActionFinished/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **npc_id**: the npc identifier.
|
||||||
|
* `int` **action_type**: the action type.
|
||||||
|
* `int` **action_id**: the unique action identifier.
|
||||||
|
* `bool` **result**: the result of finished action.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onNpcActionFinished')
|
||||||
|
def onActionFinished(**kwargs):
|
||||||
|
print(f'NPC {kwargs['npc_id']} finished action {kwargs['action_type']} with the result {kwargs['result']}.')
|
||||||
|
```
|
||||||
20
docs/defaultEvents/npc/onNpcActionSent.md
Normal file
20
docs/defaultEvents/npc/onNpcActionSent.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# `event` onNpcActionSent
|
||||||
|
|
||||||
|
This event is triggered when NPC host is changed. Every remote NPC is hosted by one of spawned players in order to get valid position of NPC.
|
||||||
|
|
||||||
|
Original: [onNpcActionSent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcActionSent/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **npc_id**: the npc identifier.
|
||||||
|
* `int` **current_id**: the action type.
|
||||||
|
* `int` **previous_id**: the unique action identifier.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onNpcActionSent')
|
||||||
|
def onActionSent(**kwargs):
|
||||||
|
print(f'NPC {kwargs['npc_id']} changed host from {kwargs['previous_id']} to {kwargs['current_id']}.')
|
||||||
|
```
|
||||||
20
docs/defaultEvents/npc/onNpcChangeHostPlayer.md
Normal file
20
docs/defaultEvents/npc/onNpcChangeHostPlayer.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# `event` onNpcChangeHostPlayer
|
||||||
|
|
||||||
|
This event is triggered when server sends NPC action to streamed players.
|
||||||
|
|
||||||
|
Original: [onNpcChangeHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcChangeHostPlayer/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **npc_id**: the id of the remote npc.
|
||||||
|
* `int` **current_id**: the id of the current host, can be -1 if there is no current host.
|
||||||
|
* `int` **previous_id**: the id of the previous host, can be -1 if there was no previous host.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onNpcChangeHostPlayer')
|
||||||
|
def onChangeHostPlayer(**kwargs):
|
||||||
|
print(f'NPC {kwargs['npc_id']} sent {kwargs['action_type']} to all players.')
|
||||||
|
```
|
||||||
18
docs/defaultEvents/npc/onNpcCreated.md
Normal file
18
docs/defaultEvents/npc/onNpcCreated.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# `event` onNpcCreated
|
||||||
|
|
||||||
|
This event is triggered when remote NPC is created.
|
||||||
|
|
||||||
|
Original: [onNpcCreated](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcCreated/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **npc_id**: the id of the newly created remote npc.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onNpcCreated')
|
||||||
|
def onNpcCreate(**kwargs):
|
||||||
|
print(f'NPC {kwargs['npc_id']} has been created.')
|
||||||
|
```
|
||||||
18
docs/defaultEvents/npc/onNpcDestroyed.md
Normal file
18
docs/defaultEvents/npc/onNpcDestroyed.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# `event` onNpcDestroyed
|
||||||
|
|
||||||
|
This event is triggered when remote NPC is created.
|
||||||
|
|
||||||
|
Original: [onNpcDestroyed](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/npc/onNpcDestroyed/)
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
* `dict` **kwargs**:
|
||||||
|
* `int` **npc_id**: the id of the destroyed remote npc.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```python
|
||||||
|
import g2o
|
||||||
|
|
||||||
|
@g2o.event('onNpcDestroyed')
|
||||||
|
def onNpcDestroy(**kwargs):
|
||||||
|
print(f'NPC {kwargs['npc_id']} has been destroyed.')
|
||||||
|
```
|
||||||
@@ -39,6 +39,8 @@ nav:
|
|||||||
- Weapon mode: constants/weapon-mode.md
|
- Weapon mode: constants/weapon-mode.md
|
||||||
- Weather: constants/weather.md
|
- Weather: constants/weather.md
|
||||||
- Events:
|
- Events:
|
||||||
|
- Anticheat:
|
||||||
|
- onPlayerUseCheat: defaultEvents/anticheat/onPlayerUseCheat.md
|
||||||
- General:
|
- General:
|
||||||
- onInit: defaultEvents/general/onInit.md
|
- onInit: defaultEvents/general/onInit.md
|
||||||
- onExit: defaultEvents/general/onExit.md
|
- onExit: defaultEvents/general/onExit.md
|
||||||
@@ -48,6 +50,12 @@ nav:
|
|||||||
- onUnban: defaultEvents/general/onUnban.md
|
- onUnban: defaultEvents/general/onUnban.md
|
||||||
- Network:
|
- Network:
|
||||||
- onPacket: defaultEvents/network/onPacket.md
|
- onPacket: defaultEvents/network/onPacket.md
|
||||||
|
- Npc:
|
||||||
|
- onNpcActionFinished: defaultEvents/npc/onNpcActionFinished.md
|
||||||
|
- onNpcActionSent: defaultEvents/npc/onNpcActionSent.md
|
||||||
|
- onNpcChangeHostPlayer: defaultEvents/npc/onNpcChangeHostPlayer.md
|
||||||
|
- onNpcCreated: defaultEvents/npc/onNpcCreated.md
|
||||||
|
- onNpcDestroyed: defaultEvents/npc/onNpcDestroyed.md
|
||||||
- Player:
|
- Player:
|
||||||
- onPlayerChangeColor: defaultEvents/player/onPlayerChangeColor.md
|
- onPlayerChangeColor: defaultEvents/player/onPlayerChangeColor.md
|
||||||
- onPlayerChangeFocus: defaultEvents/player/onPlayerChangeFocus.md
|
- onPlayerChangeFocus: defaultEvents/player/onPlayerChangeFocus.md
|
||||||
|
|||||||
Reference in New Issue
Block a user