The new site of Sapp!

Event System

Events were introduced to let server admins customize actions performed by server when something happens. For example, you can enable kick on third betray with the following command:
event_tk $tk=3 'sv_kick $n'


General syntax for adding events is: event_[type] [event condition(s)] 'command(s separated by ;)'


Here is the list of variables that can be used in event's command line and also as argument:

$n - PlayerIndex from sv_players / pl
$name - Player's name
$hash - Player's cd-key hash
$ip - Player's ip
$tk - Player's TK (betray) count
$kills - Player's kill count
$assists - Player's assist count
$deaths
- Player's death count
$suicides
- Player's suicide count
$streak -
Killstreak count of the player (number of kills without die)
$combo -
Combo count, like 2: double kill, 3: triple kill etc.
$score
- Player's score
$botscore - The player's current aimbot score
$afk - Player's afk timer
$ping - Player's ping
$x - Player's x coordinate
$y - Player's y coordinate
$z - Player's z coordinate
$hp - Player's health
$sh - Player's shield
$invis - 0: Player is visible, 1: Player is invisible
$team - Player's team
$oteam - Opposite team of the player
$lvl - Admin level of the player, not admin: -1, admin : 0 to 4
$map - The name of the current map
$mode - The name of the current gamemode
$gt - The type of the current game (ex: ctf, slayer, etc.)
$ffa -  0: Team game, 1: FreeForAll
$svname - The name of the server
$redscore - The score of the read team
$bluescore - The score of the blue team
$pn - The number of the players in the server
$reds - The number of the players in the red team
$blues - The number of the players in the blue team
$rand - Gives a random number from 1 to 16

If an event doesn't have any conditions, it will execute always when its get called. If it has conditions, it will only execute if all passed. The operators in the arguments can be the following:
: and !: at a string, ex: $map:bloodgulch, $mode!:cbctf, $name:New1337
=  !=  >  >=  <  <=  at a number, ex: $kills=25, $lvl>=0, $kills<$deaths, etc.
ps.: !: and != referrers to "not equal"

event_tick conditions 'command' event is executed once every thread cycle (30 times per second)
event_alive conditions 'command' event is executed once a second if the player is alive
event_tk conditions 'command' event is executed when a player betrays somebody
event_kill conditions 'command' event is executed when a player kills someone. special argument: $killed; 1-16 the player who got killed by the current one
event_score conditions 'command' event is executed when a player Captures a Flag.
event_suicide conditions 'command' event is executed when a player committed suicide
event_start conditions 'command' event is executed when a map starts
event_end conditions 'command' event is executed when a specified map ends
event_reset conditions 'command' event is executed when the sv_map_reset command is used
event_prejoin conditions 'command' event is executed when a player machine joins
event_join conditions 'command' event is executed when player joins the server
event_leave conditions 'command' event is executed when player leaves the server
event_prespawn conditions 'command' event is executed when player spawns, before client notifications
event_spawn conditions 'command' event is executed when player spawns, after client notifications
event_die conditions 'command' event is executed when player dies. special argument: $killer; -1:"died", 0:player was killed by a vehicle, ai, "guardians", 1-16: the $n of the player who killed the current one
event_teamswitch conditions 'command' event executed on player's team change.
event_wpickup conditions 'command' event executed when a player picks up a weapon. special arguments: $type: 1 means weapon, 2 means nade
$index: If $type is 1, this is the weapon slot where the new weapon got added, can be 1 to 4. If $type is 2, this is the type of the nade that got picked up, 1 means frag nade and 2 means plasma nade.
event_wdrop conditions 'command' Called when a player drops a weapon or a flag\oddball. special argument is $index, which is the number of the slot where the player dropped the weapon from, can be 1 to 4.
event_venter conditions 'command' event executed when a player enters to a vehicle, special argument: $seat, usually 0 - driver, 1 - passenger, 2 - gunner
event_vexit conditions 'command' event executed when a player exits from a vehicle
event_snap conditions 'command' event executed when a player snaps to another player (if aimbot scan is enabled). Special argument: $snapscore, the amount of score gained with this snap
event_camp conditions 'command' special event for the command anticamp, executes when a player is camping and kills a player, special argument: $campkills, the number of kills that the player gained during camp
event_warp conditions 'command' event executed after the player warped 'n' amount of times defined with 'antiwarp n' command (if n > 0). Note that the number of warps of a player will be reset to 0 after the player didn't warp for 5 seconds.
event_aenter conditions 'command' A Player enters to an area. Special argument: $area - the name of the area that the player enter into.
event_aexit conditions 'command' A Player exits from an area. Special argument: $area - the name of the area that the player left.
event_login conditions 'command' event executed when an admin logged in with the login command
event_custom conditions 'command' The event is executed when the cevent command is called. Special argument: $ename - the name of the custom event specified with the cevent command.
cevent <name> [player_number] Executes an event_custom. This is useful when you execute an event after a "wait/w8" command and need to check the conditions for the current state.
events Displays all events
eventdel index Deletes event from queue. Use 'events' to find index
wait n Wait n milliseconds before executing next command (1 second = 1000 milliseconds)
w8 n Wait n seconds before executing next command

See the example below:

Place this into the "gametypes folder"\sapp\events.txt: (for ex "C:\Users\Username\Documents\My Games\Halo CE\sapp", or cg\sapp in Gameservers)

event_join $lvl>1 'wait 1000;say * "Admin $name has joined!"'
event_join 'w8 10;say $n "Please follow the rules or you might get kicked or banned!" '
event_kill $kills=25 'say $n "25 kills, not bad $name!" '
event_kill $kills=100 'say $n "WoW, you have 100 kills $name!" '
event_kill $kills=500 'say $n "MDROFLOLMFAOMFG $name, you have 500 kills !!!" '
event_score 'say $n "Good Job, $name!" '
event_tk 'say $n "$name do not betray your teammates you idiot!" '
event_start 'w8 15;say * "Map skipping is enabled! Type SKIP to vote to skip this map!"'
event_end 'say * "Server Powered by SAPP, xhalo.tk"'
event_teamswitch 'say $n "Welcome to the $team team, $name!" '

Note: Do NOT use the ' (apostrophe) character in the say command at the events!
(Example: Good usage: "do not", "will not", etc. Bad usage: "don't", "won't", etc.)

Downloads

SAPP for Halo PC

Download

SAPP for Halo CE

Download