EVENT scripts

Revision as of 15:01, 26 February 2021 by AKMDM (talk | contribs) (Replaced "3.1 only" with "Zandronum 3.1 only".)

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. In Zandronum 3.1, arg2 returns the number of points earned.
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).
GAMEEVENT_CHAT 8 (Zandronum 3.1 only)
When a chat message is sent. The activator is always the world, arg1 is the number of the player who sent the message (if the server sent the message, -1 is passed instead), and arg2 is set to 0 if it was a global chat message or 1 if it was a team chat message.