Difference between revisions of "Generic Source Server Events"

From AlliedModders Wiki
Jump to: navigation, search
(server_spawn: server_start does not exist)
m (Fix for {{3}}. Seriously, how many pages are missing the third argument for hl2msg?)
Line 5: Line 5:
 
{{qnotice|Send once a server starts (spawns)}}<br>
 
{{qnotice|Send once a server starts (spawns)}}<br>
 
{{begin-hl2msg|server_spawn|string}}
 
{{begin-hl2msg|server_spawn|string}}
{{hl2msg|string|hostname}}
+
{{hl2msg|string|hostname|}}
{{hl2msg|string|address}}
+
{{hl2msg|string|address|}}
{{hl2msg|string|port}}
+
{{hl2msg|string|port|}}
{{hl2msg|string|game}}
+
{{hl2msg|string|game|}}
{{hl2msg|string|mapname}}
+
{{hl2msg|string|mapname|}}
{{hl2msg|long|maxplayers}}
+
{{hl2msg|long|maxplayers|}}
{{hl2msg|string|os}}
+
{{hl2msg|string|os|}}
{{hl2msg|bool|dedicated}}
+
{{hl2msg|bool|dedicated|}}
{{hl2msg|bool|password}}
+
{{hl2msg|bool|password|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 19: Line 19:
 
{{qnotice|Server shut down}}
 
{{qnotice|Server shut down}}
 
{{begin-hl2msg|server_shutdown|string}}
 
{{begin-hl2msg|server_shutdown|string}}
{{hl2msg|string|reason}}
+
{{hl2msg|string|reason|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 25: Line 25:
 
{{qnotice|A server console var has changed}}
 
{{qnotice|A server console var has changed}}
 
{{begin-hl2msg|server_cvar|string}}
 
{{begin-hl2msg|server_cvar|string}}
{{hl2msg|string|cvarname}}
+
{{hl2msg|string|cvarname|}}
{{hl2msg|string|cvarvalue}}
+
{{hl2msg|string|cvarvalue|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 32: Line 32:
 
{{qnotice|A generic server message}}
 
{{qnotice|A generic server message}}
 
{{begin-hl2msg|server_message|string}}
 
{{begin-hl2msg|server_message|string}}
{{hl2msg|string|text}}
+
{{hl2msg|string|text|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 38: Line 38:
 
{{qnotice|When the server has a ban added}}
 
{{qnotice|When the server has a ban added}}
 
{{begin-hl2msg|server_addban|string}}
 
{{begin-hl2msg|server_addban|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|}}
{{hl2msg|string|userid}}
+
{{hl2msg|string|userid|}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|}}
{{hl2msg|string|ip}}
+
{{hl2msg|string|ip|}}
{{hl2msg|string|duration}}
+
{{hl2msg|string|duration|}}
{{hl2msg|string|by}}
+
{{hl2msg|string|by|}}
{{hl2msg|bool|kicked}}
+
{{hl2msg|bool|kicked|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 50: Line 50:
 
{{qnotice|When the server has a ban removed}}
 
{{qnotice|When the server has a ban removed}}
 
{{begin-hl2msg|server_removeban|string}}
 
{{begin-hl2msg|server_removeban|string}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|}}
{{hl2msg|string|ip}}
+
{{hl2msg|string|ip|}}
{{hl2msg|stsring|by}}
+
{{hl2msg|stsring|by|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 58: Line 58:
 
{{qnotice|A new player connected}}
 
{{qnotice|A new player connected}}
 
{{begin-hl2msg|player_connect|string}}
 
{{begin-hl2msg|player_connect|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|}}
{{hl2msg|byte|index}}
+
{{hl2msg|byte|index|}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|}}
{{hl2msg|string|address}}
+
{{hl2msg|string|address|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 68: Line 68:
 
{{qnotice|A player changed his name}}
 
{{qnotice|A player changed his name}}
 
{{begin-hl2msg|player_info|string}}
 
{{begin-hl2msg|player_info|string}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|}}
{{hl2msg|byte|index}}
+
{{hl2msg|byte|index|}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|}}
{{hl2msg|bool|bot}}
+
{{hl2msg|bool|bot|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 78: Line 78:
 
{{qnotice|A client was disconnected}}
 
{{qnotice|A client was disconnected}}
 
{{begin-hl2msg|player_disconnect|string}}
 
{{begin-hl2msg|player_disconnect|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|}}
{{hl2msg|string|reason}}
+
{{hl2msg|string|reason|}}
{{hl2msg|string|name}}
+
{{hl2msg|string|name|}}
{{hl2msg|string|networkid}}
+
{{hl2msg|string|networkid|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 87: Line 87:
 
{{qnotice|A client has entered the game (connected and loaded)}}
 
{{qnotice|A client has entered the game (connected and loaded)}}
 
{{begin-hl2msg|player_activate|string}}
 
{{begin-hl2msg|player_activate|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 93: Line 93:
 
{{qnotice|When a client sends a message in chat}}
 
{{qnotice|When a client sends a message in chat}}
 
{{begin-hl2msg|player_say|string}}
 
{{begin-hl2msg|player_say|string}}
{{hl2msg|short|userid}}
+
{{hl2msg|short|userid|}}
{{hl2msg|string|text}}
+
{{hl2msg|string|text|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}

Revision as of 13:37, 15 July 2011

Refer back to Game Events (Source) for more events.

These should apply to all Source Engine Servers

server_spawn

Note: Send once a server starts (spawns)

Name: server_spawn
Structure:
string hostname
string address
string port
string game
string mapname
long maxplayers
string os
bool dedicated
bool password


server_shutdown

Note: Server shut down

Name: server_shutdown
Structure:
string reason


server_cvar

Note: A server console var has changed

Name: server_cvar
Structure:
string cvarname
string cvarvalue


server_msg

Note: A generic server message

Name: server_message
Structure:
string text


server_addban

Note: When the server has a ban added

Name: server_addban
Structure:
string name
string userid
string networkid
string ip
string duration
string by
bool kicked


server_removeban

Note: When the server has a ban removed

Name: server_removeban
Structure:
string networkid
string ip
stsring by


player_connect

Note: A new player connected

Name: player_connect
Structure:
string name
byte index
short userid
string networkid
string address


player_info

Note: A player changed his name

Name: player_info
Structure:
string name
byte index
short userid
string networkid
bool bot


player_disconnect

Note: A client was disconnected

Name: player_disconnect
Structure:
short userid
string reason
string name
string networkid


player_activate

Note: A client has entered the game (connected and loaded)

Name: player_activate
Structure:
short userid


player_say

Note: When a client sends a message in chat

Name: player_say
Structure:
short userid
string text