EVENT scripts

From Zandronum Wiki
Jump to: navigation, search

EVENT scripts are scripts that are triggered by various in-game events:

script 123 (int type, int arg1, int arg2) EVENT

The event that caused the script to be fired is enumerated into the type argument. arg1 and arg2 may or may not be used (depending on the event type) to provide additional data.

Script types

GAMEEVENT_PLAYERFRAGS 0
Player frags another player. The activator is the killing player and arg1 is the number of the player who was fragged.
GAMEEVENT_MEDALS 1
Player receives a medal. The activator is the player who recieves the medal and arg1 is the string containing the name of the medal.
GAMEEVENT_CAPTURES 2
Player captures the flag/skull. The activator is the capturing player and arg1 is the player who assisted. If nobody assisted the capture, -1 is supplied instead.
GAMEEVENT_TOUCHES 3
Player touches the flag/skull. The activator is the player who touched the team item and arg1 is the team index of the team whose flag/skull was touched.
GAMEEVENT_RETURNS 4
The flag/skull is returned. The activator is the player who returned the team item (or the world if the item was automatically returned), arg1 is the index of the team whose item was returned. arg2 is set to 0 if the return was done automatically or 1 if it was done by a player.
GAMEEVENT_ROUND_STARTS 5
When the round starts.
GAMEEVENT_ROUND_ENDS 6
The current round ends and the win sequence starts, e.g. when the fraglimit is hit.
GAMEEVENT_ROUND_ABORTED 7
If the round is aborted (e.g. in duel where one of the combatants leaves the game).