https://wiki.alliedmods.net/api.php?action=feedcontributions&user=Naleksuh&feedformat=atomAlliedModders Wiki - User contributions [en]2024-03-28T16:39:04ZUser contributionsMediaWiki 1.31.6https://wiki.alliedmods.net/index.php?title=Generic_Source_Server_Events&diff=11192Generic Source Server Events2021-05-20T05:33:21Z<p>Naleksuh: /* player_disconnect */ doesn't return any of these 5 strings but returns the regular string shown ingame</p>
<hr />
<div>:''Refer back to [[Game Events (Source)]] for more events.''<br />
<br />
These '''should''' apply to all Source Engine Servers<br />
=== server_spawn ===<br />
{{qnotice|Send once a server starts (spawns)}}<br><br />
{{begin-hl2msg|server_spawn|string}}<br />
{{hl2msg|string|hostname|public host name}}<br />
{{hl2msg|string|address|hostame, IP or DNS name}}<br />
{{hl2msg|string|ip|}}<br />
{{hl2msg|string|port|server port}}<br />
{{hl2msg|string|game|game dir}}<br />
{{hl2msg|string|mapname|map name}}<br />
{{hl2msg|long|maxplayers|max players}}<br />
{{hl2msg|string|os|WIN32, LINUX}}<br />
{{hl2msg|bool|dedicated|true if dedicated server}}<br />
{{hl2msg|bool|official|true if official valve dedicated server}}<br />
{{hl2msg|bool|password|true if password protected}}<br />
{{end-hl2msg}}<br />
<br />
=== server_shutdown ===<br />
{{qnotice|Server shut down}}<br />
{{begin-hl2msg|server_shutdown|string}}<br />
{{hl2msg|string|reason|reason why server was shut down}}<br />
{{end-hl2msg}}<br />
<br />
=== server_cvar ===<br />
{{qnotice|A server console var has changed}}<br />
{{begin-hl2msg|server_cvar|string}}<br />
{{hl2msg|string|cvarname|cvar name, eg "mp_roundtime"}}<br />
{{hl2msg|string|cvarvalue|new cvar value}}<br />
{{end-hl2msg}}<br />
<br />
=== server_message ===<br />
{{qnotice|A generic server message}}<br />
{{begin-hl2msg|server_message|string}}<br />
{{hl2msg|string|text|the message text}}<br />
{{end-hl2msg}}<br />
<br />
=== server_addban ===<br />
{{qnotice|When the server has a ban added}}<br />
{{begin-hl2msg|server_addban|string}}<br />
{{hl2msg|string|name|player name}}<br />
{{hl2msg|string|userid|user ID on server}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|string|ip|IP address}}<br />
{{hl2msg|string|duration|length of the ban}}<br />
{{hl2msg|string|by|banned by...}}<br />
{{hl2msg|bool|kicked|whether the player was also kicked}}<br />
{{end-hl2msg}}<br />
<br />
=== server_removeban ===<br />
{{qnotice|When the server has a ban removed}}<br />
{{begin-hl2msg|server_removeban|string}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|string|ip|IP address}}<br />
{{hl2msg|string|by|removed by...}}<br />
{{end-hl2msg}}<br />
<br />
=== player_connect ===<br />
{{qnotice|A new client connected}}<br />
{{begin-hl2msg|player_connect|string}}<br />
{{hl2msg|string|name|player name}}<br />
{{hl2msg|byte|index|player slot (entity index-1)}}<br />
{{hl2msg|short|userid|user ID on server (unique on server)}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|string|address|ip:port}}<br />
{{hl2msg|short|bot|is a bot}}<br />
{{end-hl2msg}}<br />
<br />
=== player_connect_client ===<br />
{{qnotice|A new client connected, only present in OB}}<br />
{{begin-hl2msg|player_connect_client|string}}<br />
{{hl2msg|string|name|player name}}<br />
{{hl2msg|byte|index|player slot (entity index-1)}}<br />
{{hl2msg|short|userid|user ID on server (unique on server)}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|short|bot|is a bot}}<br />
{{end-hl2msg}}<br />
<br />
=== player_info ===<br />
{{qnotice|A player changed his name}}<br />
{{begin-hl2msg|player_info|string}}<br />
{{hl2msg|string|name|player name}}<br />
{{hl2msg|byte|index|player slot (entity index-1)}}<br />
{{hl2msg|short|userid|user ID on server (unique on server)}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|bool|bot|true if player is a AI bot}}<br />
{{end-hl2msg}}<br />
<br />
=== player_disconnect ===<br />
{{qnotice|A client was disconnected}}<br />
{{begin-hl2msg|player_disconnect|string}}<br />
{{hl2msg|short|userid|user ID on server}}<br />
{{hl2msg|string|reason|reason the player left the server}}<br />
{{hl2msg|string|name|player name}}<br />
{{hl2msg|string|networkid|player network (i.e steam) id}}<br />
{{hl2msg|short|bot|is a bot}}<br />
{{end-hl2msg}}<br />
<br />
=== player_activate ===<br />
{{qnotice|A client has entered the game (connected and loaded)}}<br />
{{begin-hl2msg|player_activate|string}}<br />
{{hl2msg|short|userid|user ID on server}}<br />
{{end-hl2msg}}<br />
<br />
=== player_say ===<br />
{{qnotice|When a client sends a message in chat}}<br />
{{begin-hl2msg|player_say|string}}<br />
{{hl2msg|short|userid|user ID on server}}<br />
{{hl2msg|string|text|the say text}}<br />
{{end-hl2msg}}</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Reserved_Slots_(SourceMod)&diff=11175Reserved Slots (SourceMod)2021-03-05T02:32:26Z<p>Naleksuh: /* Reserve Type */</p>
<hr />
<div>{{Languages|Reserved Slots (SourceMod)}}<br />
==Cvars==<br />
<br />
*[[#Reserve Type|sm_reserve_type <0|1|2>]]<br />
*[[#Reserved Slots|sm_reserved_slots <#>]]<br />
*[[#Hidden Slots|sm_hide_slots <0|1>]]<br />
*[[#Max Admins|sm_reserve_maxadmins <#>]]<br />
*[[#Kick Type|sm_reserve_kicktype <0|1|2>]]<br />
<br />
==Reserve Type==<br />
<br />
sm_reserve_type <0|1|2><br />
<br />
This controls how reserve slots work on the server (the default is 0).<br />
<br />
* <tt>sm_reserve_type 0</tt><br />
<br />
Public slots are used in preference to reserved slots. Reserved slots are freed before public slots.<br />
No players are ever kicked and once reserved slots are filled by a reserve slot player (and the rest of the server is full) they will remain occupied until a player leaves.<br />
The use of this is that there can always be at least one admin (assuming you only give reserved slots to admins) on the server at any time. If players inform you that there is a cheater on the server, at least one admin should be able to get it and do something about it.<br />
If a player without reserve slot access joins when there are only reserved spaces remaining they will be kicked from the server.<br />
<br />
* <tt>sm_reserve_type 1</tt><br />
<br />
If someone with reserve access joins into a reserved slot, the player with the highest latency and without reserve access (spectator players are selected first) is kicked to make room. Thus, the reserved slots always remain free. The only situation where the reserved slot(s) can become properly occupied is if the server is full with reserve slot access clients. <br />
This is for servers that want some people to have playing preference over other. With this method admins could one by one join a full server until they all get in.<br />
<br />
* <tt>sm_reserve_type 2</tt> - Only available in SourceMod 1.1 or higher.<br />
<br />
The same as sm_reserve_type 1 except once a certain number of admins have been reached the reserve slot stops kicking people and anyone can join to fill the server.<br />
You can use this to simulate having a large number of reserved slots with sm_reserve_type 0 but with only need to have 1 slot unavailable when there are less admins connected.<br />
<br />
==Reserved Slots==<br />
<br />
sm_reserved_slots <#><br />
<br />
This controls how many slots get reserved by the plugin (the default is 0). <br />
<br />
Using sm_reserve_type 0 this is how many admins can join the server after it appears full to the public.<br />
Using sm_reserve_type 1 this is how many slots are saved for swapping admins in (you shouldn't need more than one)<br />
<br />
==Hidden Slots==<br />
<br />
sm_hide_slots <0|1><br />
<br />
This controls the plugin hides the reserved slots (the default is 0).<br />
<br />
If enabled (1) reserve slots are hidden in the server browser window when they are not in use. For example a 24 player server with 2 reserved slots will show as a 22 player server (until the reserved slots are occupied).<br />
To connect to the reserved slot of a server that shows as full you will need to use 'connect ip:port' in console. (e.g. 'connect 192.168.1.100:27015')<br />
<br />
There is no possible way for the reserved slots to be visible to admins and hidden from normal users. Admin authentication can only happen after the user is fully connected to the server and their steam id is available to SourceMod. For this reason it is often better to hide the slots otherwise public users will attempt to join the server and will get kicked again (rendering the ‘autojoin’ feature useless)<br />
<br />
==Max Admins==<br />
<br />
sm_reserve_maxadmins <#> - Only available in SourceMod 1.1 or higher.<br />
<br />
This controls how many admins can join the server before the reserved slots are made public (only relevant to sm_reserve_type 2) <br />
<br />
==Kick Type==<br />
<br />
sm_reserve_kicktype <0|1|2> - Only available in SourceMod 1.1 or higher.<br />
<br />
This controls how a client is selected to be kicked (only relevant to sm_reserve_type 1/2)<br />
<br />
Clients with reserve slot access or the override 'sm_reskick_immunity' are always immune to being kicked. Spectating clients are chosen before playing clients.<br />
<br />
0 - Highest Ping<br><br />
1 - Highest Connection Time<br><br />
2 - Random Player<br><br />
<br />
==Immunity==<br />
<br />
To make players immune from being kicked by the reserved slots plugin they need to have access to the override 'sm_reskick_immunity' (users with root or reserved slot access are already immune).<br />
<br />
NB: This is only relevant when using sm_reserve_type 1/2.<br />
<br />
You can either assign this override to a flag using admin_overrides.cfg (e.g. "sm_reskick_immunity" "o" - to give all users with flag 'o' (custom flag 1) immunity from being kicked)<br />
<br />
Or<br />
<br />
Give groups access to the overrides in admin_groups.cfg (e.g. "sm_reskick_immunity" "allow")<br />
<br />
Then add your VIP members or other users you wish to be immune from being kicked as admins with either the flag you specified or as members of the group you gave access to. (You can create a group with 0 flags and ‘0’ normal immunity and only this override if you don't want them to have any other privileges) <br />
<br />
Full details on overriding command access can be found at [[Overriding Command Access (SourceMod)]]<br />
<br />
==Possible Future Additions==<br />
<br />
These are possible feature additions that have been requested and are under consideration for inclusion in later versions of SourceMod<br />
<br />
*Choice to redirect players instead of kicking.<br />
<br />
[[Category:SourceMod Documentation|Categories]]</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Introduction_to_SourceMod_Plugins&diff=11143Introduction to SourceMod Plugins2021-01-29T19:38:29Z<p>Naleksuh: /* Setting up plugin info */ new syntax</p>
<hr />
<div>This guide will give you a basic introduction to writing a [[SourceMod]] plugin. If you are not familiar with the SourcePawn language, it is recommended that you at least briefly read the [[Introduction to SourcePawn]] article.<br />
<br />
For information on compiling plugins, see [[Compiling SourceMod Plugins]]. You can use [https://forums.alliedmods.net/showthread.php?p=2693577 SPCode], [https://www.crimsoneditor.com/ Crimson Editor], [http://www.pspad.com/ PSPad], [http://www.ultraedit.com/ UltraEdit], [https://notepad-plus-plus.org/ Notepad++], [https://www.textpad.com/ TextPad], [http://sourceforge.net/projects/pawnstudio/ Pawn Studio], [https://forums.alliedmods.net/showthread.php?t=289127 BasicPawn] or any other text editor you're comfortable with to write plugins.<br />
<br />
=Starting from scratch=<br />
Open your favorite text editor and create a new empty file. When you have an empty file you can just start writing code using the core language, however, you will not be able to use any of SourceMod features because the compiler does not know about them. This is done deliberately so it is possible to use SourcePawn outside of SourceMod. But since we are writing a SourceMod plugin, it is a good idea to enable access to SourceMod features first. This is done using <tt>#include</tt> directive. It tells the compiler to "paste" the code from another file into yours.<br />
<pawn>#include <sourcemod></pawn><br />
How does this work? First of all, note that we enclosed file name into angle brackets. Angle brackets tell the compiler to look in the default include directory. By default, it is '''scripting/include'''. You can open it right now and see a lot of inc files there. Those are SourceMod include files that describe various functions, tags and other features available for SourceMod plugins. The files are plain-text and you are encouraged to read them. You will notice, however, that there's not much code in there, certainly not enough to implement all the great features of SourceMod, so where are they? They are implemented inside a SourceMod core which is written in C++ and is compiled into binary files which end up in '''bin''' directory. So how does your SourcePawn code and SM core link together if the compiler doesn't know about the existence of the latter? SourceMod include files are written specially, so they say that the implementation of functions is ''somewhere else''. The compiler understands that and generates a special code that says that this function call is going outside. When SourceMod loads your plugin, it inspects these bits of code and substitutes it's own internal functions instead. This is called [http://en.wikipedia.org/wiki/Dynamic_linking dynamic linking].<br />
<br />
=Setting up plugin info=<br />
Now that we got access to SourceMod features, it is time to set up the information that will be displayed via <tt>sm plugins list</tt> command. No one likes unnamed plugins. To do that we are going to look inside '''sourcemod.inc''' file and see the format that information should be declared. It's always helpful to look inside SM include files to find out information you don't know. There is also an [http://docs.sourcemod.net/api/ API documentation] but it can be outdated and it only has SM core files so if your plugin is going to use any third party extension or another plugin, you will have to study inc files. So, open '''sourcemod.inc''' and scroll down a bit until you see this:<br />
<sourcepawn>/**<br />
* Plugin public information.<br />
*/<br />
struct Plugin<br />
{<br />
public const char[] name; /**< Plugin Name */<br />
public const char[] description; /**< Plugin Description */<br />
public const char[] author; /**< Plugin Author */<br />
public const char[] version; /**< Plugin Version */<br />
public const char[] url; /**< Plugin URL */<br />
};</sourcepawn><br />
and this:<br />
<sourcepawn>/**<br />
* Declare this as a struct in your plugin to expose its information.<br />
* Example:<br />
*<br />
* public Plugin myinfo =<br />
* {<br />
* name = "My Plugin",<br />
* //etc<br />
* };<br />
*/<br />
public Plugin myinfo;</sourcepawn><br />
<br />
It tells us that we need to create a global public variable <tt>myinfo</tt> which must be of type <tt>Plugin</tt> which is a struct with 5 fields which themselves are strings. It may sound complicated for a beginner but it's easy. Let's go ahead and create one:<br />
<sourcepawn>public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};</sourcepawn><br />
<br />
The <tt>public</tt> keyword means that SourceMod will be able to directly access our variable. <tt>Plugin</tt> defines a type of our variable. <tt>myinfo</tt> is, obviously, a name of our variable as required by SourceMod. You see that we initialize it right away. This is the preferable way to fill out plugin info.<br />
<br />
After that the full code of your plugin should look like this:<br />
<sourcepawn>#include <sourcemod><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};</sourcepawn><br />
<br />
=Getting code to run=<br />
We already include SourceMod features and filled up or plugin info. We now have a perfectly well-formed plugin which can be compiled and loaded by SourceMod. However, there is one problem - it does nothing. You might be tempted to just start writing a code after <tt>myinfo</tt> declaration just to see that it will not compile. SourcePawn, unlike other scripting languages like Lua, does not allow a code to be outside of functions. After reading that, you may probably want to just define some function, name it <tt>main</tt> probably, compile and load a plugin and see that your code never gets called. So how do we make SourceMod call our code? For this exact reason, we have forwards. Forwards are function prototypes declared by one party that can be implemented by another party as a [http://en.wikipedia.org/wiki/Callback_%28computer_programming%29 callback]. When a first party starts a forward call, all parties that have matching callbacks receive the call. SourceMod declares a plenty of interesting forwards that we can implement. As you can see, forwards are the only way to get our code executed, keep that in mind. So let's implement <tt>OnPluginStart</tt> forward. As you may have guessed, it is called when our plugin starts. To do that, we'll have to look up the declaration of <tt>OnPluginStart</tt>. It is declared inside '''sourcemod.inc''', a file we are already familiar with, let's find it:<br />
<sourcepawn>/**<br />
* Called when the plugin is fully initialized and all known external references <br />
* are resolved. This is only called once in the lifetime of the plugin, and is <br />
* paired with OnPluginEnd().<br />
*<br />
* If any run-time error is thrown during this callback, the plugin will be marked <br />
* as failed.<br />
*<br />
* It is not necessary to close any handles or remove hooks in this function. <br />
* SourceMod guarantees that plugin shutdown automatically and correctly releases <br />
* all resources.<br />
*<br />
* @noreturn<br />
*/<br />
forward void OnPluginStart();</sourcepawn><br />
Empty parentheses tell us that no arguments are passed inside this forward, <tt>@noreturn</tt> inside documentation tells us that we don't have to return anything, pretty simple forward. So how to write a correct callback for it? Firstly, our callback must have the same name, so it's <tt>OnPluginStart</tt>, secondly, our callback should have the same number of arguments, none in this case, and lastly, SourceMod needs to be able to call our callback so it needs to be <tt>public</tt>. So the implementation looks like this:<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
}</sourcepawn><br />
<br />
Now we can write code inside curly braces and it will be executed when our plugin starts. Let's output <tt>"Hello world!"</tt> to server console. To do that we are going to use <tt>PrintToServer</tt> function. It is declared inside '''console.inc''', however, we don't need to manually include '''console.inc''' because it is included automatically as part of '''sourcemod.inc'''.<br />
<sourcepawn>/**<br />
* Sends a message to the server console.<br />
*<br />
* @param format Formatting rules.<br />
* @param ... Variable number of format parameters.<br />
* @noreturn<br />
*/<br />
native int PrintToServer(const char[] format, any ...);</sourcepawn><br />
As you can see, this is a native function. It is implemented inside SM core. Judging by it's arguments, we can see that it is a [[Format_Class_Functions_%28SourceMod_Scripting%29|format class function]]. However, we don't need any formatting right now, so let's just pass <tt>"Hello world!"</tt> string as an only argument:<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
PrintToServer("Hello world!");<br />
}</sourcepawn><br />
That's it! The full code of your plugin should look like this:<br />
<sourcepawn>#include <sourcemod><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};<br />
<br />
public void OnPluginStart()<br />
{<br />
PrintToServer("Hello world!");<br />
}</sourcepawn><br />
Compile and load your plugin on your server and see for yourself that the message is displayed in the server console.<br />
<br />
=Includes=<br />
Pawn requires '''include files''', much like C requires header files. Include files list all of the structures, functions, callbacks, and tags that are available. There are three types of include files:<br />
*'''Core''' - <tt>sourcemod.inc</tt> and anything it includes. These are all provided by SourceMod's Core.<br />
*'''Extension''' - adds a dependency against a certain extension.<br />
*'''Plugin''' - adds a dependency against a certain plugin.<br />
<br />
Include files are loaded using the <tt>#include</tt> compiler directive.<br />
<br />
=Commands=<br />
Our first example will be writing a simple admin command to slap a player. We'll continue to extend this example with more features until we have a final, complete result.<br />
<br />
==Declaration==<br />
First, let's look at what an admin command requires. Admin commands are registered using the [https://sm.alliedmods.net/new-api/console/RegAdminCmd RegAdminCmd] function. They require a '''name''', a '''callback function''', and '''default admin flags'''. <br />
<br />
The callback function is what's invoked every time the command is used. [https://sm.alliedmods.net/new-api/console/ConCmd Click here] to see its prototype. Example:<br />
<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
}</sourcepawn><br />
<br />
Now we've successfully implemented a command -- though it doesn't do anything yet. In fact, it will say "Unknown command" if you use it! This is because you're not returning Plugin_Handled in your callback. Since you haven't, SourceMod believes you didn't want the Source Engine to know the command was registered, and it handles it so. The reason SourceMod expects your function to return Plugin_Handled is because of the Action tag you put in your function's prototype. The Action tag specifies that Command_MySlap must return one of four things. See the [https://sm.alliedmods.net/new-api/core/Action Action] enumeration in the sourcemod API to learn more about these return types and when to use them.<br />
<br />
<sourcepawn>public Action Command_MySlap(int client, int args)<br />
{<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
Now the command will report no error, but it still won't do anything. This is because returning "Plugin_Handled" in a command callback will prevent the engine from processing the command. The engine will never even see that the command was run. This is what you will want to do if you are registering a completely new command through SourceMod.<br />
<br />
==Implementation==<br />
Let's decide what the command will look like. Let's have it act like the default <tt>sm_slap</tt> command:<br />
<pre>sm_myslap <name|#userid> [damage]</pre><br />
<br />
To implement this, we'll need a few steps:<br />
*Get the input from the console. For this we use [https://sm.alliedmods.net/new-api/console/GetCmdArg GetCmdArg()].<br />
*Find a matching player. For this we use [https://sm.alliedmods.net/new-api/helpers/FindTarget FindTarget()].<br />
*Slap them. For this we use [https://sm.alliedmods.net/new-api/sdktools_functions/SlapPlayer SlapPlayer()], which requires including <tt>sdktools</tt>, an extension bundled with SourceMod.<br />
*Respond to the admin. For this we use [https://sm.alliedmods.net/new-api/console/ReplyToCommand ReplyToCommand()].<br />
<br />
Full example:<br />
<br />
<sourcepawn><br />
#include <sourcemod><br />
#include <sdktools><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0.0.0",<br />
url = "http://www.sourcemod.net/"<br />
}<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
LoadTranslations("common.phrases.txt"); // Required for FindTarget fail reply<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
<br />
/* By default, we set damage = 0 */<br />
int damage = 0;<br />
<br />
/* Get the first argument */<br />
GetCmdArg(1, arg1, sizeof(arg1));<br />
<br />
/* If there are 2 or more arguments, we set damage to<br />
* what the user specified. If a damage isn't specified<br />
* then it will stay zero. */<br />
if (args >= 2)<br />
{<br />
GetCmdArg(2, arg2, sizeof(arg2));<br />
damage = StringToInt(arg2);<br />
}<br />
<br />
/* Try and find a matching player */<br />
int target = FindTarget(client, arg1);<br />
if (target == -1)<br />
{<br />
/* FindTarget() automatically replies with the <br />
* failure reason and returns -1 so we know not <br />
* to continue<br />
*/<br />
return Plugin_Handled;<br />
}<br />
<br />
SlapPlayer(target, damage);<br />
ReplyToCommand(client, "[SM] You slapped %N for %d damage!", target, damage);<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
For more information on what %N and %d are, see [[Format Class Functions (SourceMod Scripting)|Format Class Functions]]. Note that you never need to unregister or remove your admin command. When a plugin is unloaded, SourceMod cleans it up for you.<br />
<br />
=ConVars=<br />
ConVars, also known as cvars, are global console variables in the Source engine. They can have integer, float, or string values. ConVar accessing is done through [[Handles (SourceMod Scripting)|Handles]]. Since ConVars are global, you do not need to close ConVar Handles (in fact, you cannot).<br />
<br />
The handy feature of ConVars is that they are easy for users to configure. They can be placed in any .cfg file, such as <tt>server.cfg</tt> or <tt>sourcemod.cfg</tt>. To make this easier, SourceMod has an [https://sm.alliedmods.net/new-api/sourcemod/AutoExecConfig AutoExecConfig()] function. This function will automatically build a default .cfg file containing all of your cvars, annotated with comments, for users. It is highly recommended that you call this if you have customizable ConVars.<br />
<br />
Let's extend your example from earlier with a new ConVar. Our ConVar will be <tt>g_cvarMySlapDamage</tt> and will specify the default damage someone is slapped for if no damage is specified.<br />
<br />
<sourcepawn>ConVar g_cvarMySlapDamage = null;<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
<br />
g_cvarMySlapDamage = CreateConVar("sm_myslap_damage", "5", "Default slap damage");<br />
AutoExecConfig(true, "plugin_myslap");<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
int damage = g_cvarMySlapDamage.IntValue;<br />
<br />
/* The rest remains unchanged! */<br />
</sourcepawn><br />
<br />
=Showing Activity, Logging=<br />
Almost all admin commands should log their activity, and some admin commands should show their activity to in-game clients. This can be done via the [https://sm.alliedmods.net/new-api/logging/LogAction LogAction()] and [https://sm.alliedmods.net/new-api/console/ShowActivity2 ShowActivity2()] functions. The exact functionality of ShowActivity2() is determined by the <tt>sm_show_activity</tt> cvar.<br />
<br />
For example, let's rewrite the last few lines of our slap command:<br />
<sourcepawn><br />
SlapPlayer(target, damage);<br />
<br />
char name[MAX_NAME_LENGTH];<br />
<br />
GetClientName(target, name, sizeof(name));<br />
<br />
ShowActivity2(client, "[SM] ", "Slapped %s for %d damage!", name, damage);<br />
LogAction(client, target, "\"%L\" slapped \"%L\" (damage %d)", client, target, damage);<br />
<br />
return Plugin_Handled;<br />
}<br />
</sourcepawn><br />
<br />
=Multiple Targets=<br />
To fully complete our slap demonstration, let's make it support multiple targets. SourceMod's [[Admin_Commands_%28SourceMod%29#How_to_Target|targeting system]] is quite advanced, so using it may seem complicated at first. <br />
<br />
The function we use is [https://sm.alliedmods.net/new-api/commandfilters/ProcessTargetString ProcessTargetString()]. It takes in input from the console and returns a list of matching clients. It also returns a noun that will identify either a single client or describe a list of clients. The idea is that each client is then processed, but the activity shown to all players is only processed once. This reduces screen spam.<br />
<br />
This method of target processing is used for almost every admin command in SourceMod, and in fact, FindTarget() is just a simplified version.<br />
<br />
Full, final example:<br />
<sourcepawn><br />
#include <sourcemod><br />
#include <sdktools><br />
<br />
ConVar g_cvarMySlapDamage = null;<br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0.0.0",<br />
url = "http://www.sourcemod.net/"<br />
}<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
LoadTranslations("common.phrases.txt");<br />
<br />
g_cvarMySlapDamage = CreateConVar("sm_myslap_damage", "5", "Default slap damage");<br />
AutoExecConfig(true, "plugin_myslap");<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
int damage = g_cvarMySlapDamage.IntValue;<br />
<br />
/* Get the first argument */<br />
GetCmdArg(1, arg1, sizeof(arg1));<br />
<br />
/* If there are 2 or more arguments, and the second argument fetch <br />
* is successful, convert it to an integer.<br />
*/<br />
if (args >= 2 && GetCmdArg(2, arg2, sizeof(arg2)))<br />
{<br />
damage = StringToInt(arg2);<br />
}<br />
<br />
/**<br />
* target_name - stores the noun identifying the target(s)<br />
* target_list - array to store clients<br />
* target_count - variable to store number of clients<br />
* tn_is_ml - stores whether the noun must be translated<br />
*/<br />
char target_name[MAX_TARGET_LENGTH];<br />
int target_list[MAXPLAYERS], target_count;<br />
bool tn_is_ml;<br />
<br />
if ((target_count = ProcessTargetString(<br />
arg1,<br />
client,<br />
target_list,<br />
MAXPLAYERS,<br />
COMMAND_FILTER_ALIVE, /* Only allow alive players */<br />
target_name,<br />
sizeof(target_name),<br />
tn_is_ml)) <= 0)<br />
{<br />
/* This function replies to the admin with a failure message */<br />
ReplyToTargetError(client, target_count);<br />
return Plugin_Handled;<br />
}<br />
<br />
for (int i = 0; i < target_count; i++)<br />
{<br />
SlapPlayer(target_list[i], damage);<br />
LogAction(client, target_list[i], "\"%L\" slapped \"%L\" (damage %d)", client, target_list[i], damage);<br />
}<br />
<br />
if (tn_is_ml)<br />
{<br />
ShowActivity2(client, "[SM] ", "Slapped %t for %d damage!", target_name, damage);<br />
}<br />
else<br />
{<br />
ShowActivity2(client, "[SM] ", "Slapped %s for %d damage!", target_name, damage);<br />
}<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
=Events=<br />
Events are informational notification messages passed between objects in the server. Many are also passed from the server to the client. They are defined in .res files under the <tt>hl2/resource</tt> folder and <tt>resource</tt> folders of specific mods. For a basic listing, see [[Game Events (Source)|Source Game Events]].<br />
<br />
It is important to note a few concepts about events:<br />
*They are almost always informational. That is, blocking <tt>player_death</tt> will not stop a player from dying. It may block a HUD or console message or something else minor.<br />
*They almost always use userids instead of client indexes.<br />
*Just because it is in a resource file does not mean it is ever called, or works the way you expect it to. Mods are notorious for not properly documenting their event functionality.<br />
<br />
An example of finding when a player dies:<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
HookEvent("player_death", Event_PlayerDeath);<br />
}<br />
<br />
public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)<br />
{<br />
int victim_id = event.GetInt("userid");<br />
int attacker_id = event.GetInt("attacker");<br />
<br />
int victim = GetClientOfUserId(victim_id);<br />
int attacker = GetClientOfUserId(attacker_id);<br />
<br />
/* CODE */<br />
}</sourcepawn><br />
<br />
=Callback Orders and Pairing=<br />
SourceMod has a number of builtin callbacks about the state of the server and plugin. Some of these are paired in special ways which can confuse users.<br />
<br />
==Pairing==<br />
'''Pairing''' is SourceMod terminology. Examples of it are:<br />
*OnMapEnd() cannot be called without an OnMapStart(), and if OnMapStart() is called, it cannot be called again without an OnMapEnd().<br />
*OnClientConnected(N) for a given client N will only be called once until an OnClientDisconnected(N) for the same client N is called (which is guaranteed to happen).<br />
<br />
There is a formal definition of SourceMod's pairing. For two functions X and Y, both with input A, the following conditions hold:<br />
*If X is invoked with input A, it cannot be invoked again with the same input unless Y is called with input A.<br />
*If X is invoked with input A, it is guaranteed that Y will, at some point, be called with input A.<br />
*Y cannot be invoked with any input A unless X was called first with input A.<br />
*The relationship is described as, "X is paired with Y," and "Y is paired to X."<br />
<br />
==General Callbacks==<br />
These callbacks are listed in the order they are called, in the lifetime of a plugin and the server.<br />
<br />
*[https://sm.alliedmods.net/new-api/sourcemod/AskPluginLoad2 AskPluginLoad2()] - Called once, immediately after the plugin is loaded from the disk. This function can be used to stop a plugin from loading and return a custom error message; return APLRes_Failure and use strcopy on to replace the error string. All CreateNative and RegPluginLibrary calls should be done here. <br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnPluginStart OnPluginStart()] - Called once, after the plugin has been fully initialized and can proceed to load. Any run-time errors in this function will cause the plugin to fail to load. '''This is paired with OnPluginEnd()'''.<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnAllPluginsLoaded OnAllPluginsLoaded()] - Called once, after all non-late loaded plugins have called OnPluginStart. <br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnMapStart OnMapStart()] - Called every time the map loads. If the plugin is loaded late, and the map has already started, this function is called anyway after load, in order to preserve pairing. '''This function is paired with OnMapEnd().'''<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnConfigsExecuted OnConfigsExecuted()] - Called once per map-change after <tt>servercfgfile</tt> (usually <tt>server.cfg</tt>), <tt>sourcemod.cfg</tt>, and all plugin config files have finished executing. If a plugin is loaded after this has happened, the callback is called anyway, in order to preserve pairing. '''This function is paired with OnMapEnd().'''<br />
*At this point, most game callbacks can occur, such as events and callbacks involving clients (or other things, like OnGameFrame).<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnMapEnd OnMapEnd()] - Called when the map is about to end. At this point, all clients are disconnected, but <tt>TIMER_NO_MAPCHANGE</tt> timers are not yet destroyed. '''This function is paired to OnMapStart().'''<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnPluginEnd OnPluginEnd()] - Called once, immediately before the plugin is unloaded. '''This function is paired to OnPluginStart().'''<br />
<br />
==Client Callbacks==<br />
These callbacks are listed in no specific order, however, their documentation holds for both fake and real clients.<br />
<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientConnect OnClientConnect()] - Called when a player initiates a connection. You can block a player from connecting by returning Plugin_Stop and setting rejectmsg to an error message.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientConnected OnClientConnected()] - Called after a player connects. Signifies that the player is in-game and IsClientConnected() will return true. '''This is paired with OnClientDisconnect() for successful connections only.'''<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientAuthorized OnClientAuthorized()] - Called when a player gets a Steam ID. It is important to note that this may never be called. It may occur any time in between OnClientConnected and OnClientPreAdminCheck/OnClientDisconnect. Do not rely on it unless you are writing something that needs Steam IDs, and even then you should use OnClientPostAdminCheck().<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientPutInServer OnClientPutInServer()] - Signifies that the player is in-game and IsClientInGame() will return true.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientPostAdminCheck OnClientPostAdminCheck()] - Called after the player is '''both authorized and in-game'''. This is the best callback for checking administrative access after connect.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientDisconnect OnClientDisconnect()] - Called when a player's disconnection starts. '''This is paired to OnClientConnected().'''<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientDisconnect_Post OnClientDisconnect_Post()] - Called when a player's disconnection ends. '''This is paired to OnClientConnected().'''<br />
<br />
=Frequently Asked Questions=<br />
==Are plugins reloaded every mapchange?==<br />
Plugins, by default, are not reloaded on mapchange unless their timestamp changes. This is a feature so plugin authors have more flexibility with the state of their plugins. <br />
<br />
==Do I need to call CloseHandle in OnPluginEnd?==<br />
No. SourceMod automatically closes your Handles when your plugin is unloaded, in order to prevent memory errors.<br />
<br />
==Do I need to #include every individual .inc?==<br />
No. <tt>#include <sourcemod></tt> will give you 95% of the .incs. Similarly, <tt>#include <sdktools></tt> includes everything starting with <sdktools>.<br />
<br />
==Why don't some events fire?==<br />
There is no guarantee that events will fire. The event listing is not a specification, it is a list of the events that a game is capable of firing. Whether the game actually fires them is up to Valve or the developer.<br />
<br />
==Do I need to CloseHandle timers?==<br />
No. In fact, doing so may cause errors. Timers naturally die on their own unless they are infinite timers, in which case you can use KillTimer() or die gracefully by returning <tt>Plugin_Stop</tt> in the callback.<br />
<br />
==Are clients disconnected on mapchange?==<br />
All clients are fully disconnected before the map changes. They are all reconnected after the next map starts.<br />
<br />
If you only want to detect when a client initially connects or leaves your server, hook the [[Generic Source Server Events#player_connect|player_connect]] or [[Generic Source Server Events#player_disconnect|player_disconnect]] events respectively.<br />
<br />
==Why am I getting "function prototypes do not match" errors?==<br />
When you see this error, you'll most likely find that the issue comes from any callback functions referenced in the line(s) that are causing the error.<br />
<br />
When you call a function that takes another function as a callback, the callback function must be declared with the correct number of parameter and return types.<br />
<br />
For example, [https://sm.alliedmods.net/new-api/console/RegConsoleCmd <tt>RegConsoleCommand</tt>] must be called with a callback that has with the exact arguments and return type as specified by the [https://sm.alliedmods.net/new-api/console/ConCmd <tt>ConCmd</tt>] definition.<br />
<br />
==When do I need to manually unhook things?==<br />
You only need to do so when you do not want the callback to fire anymore while the plugin is running. SourceMod itself, as well as extensions such as SDKHooks, unhooks entities and players when they are removed and disconnected, respectively. Everything a plugin hooks is unhooked when it is unloaded.<br />
<br />
=Further Reading=<br />
For further reading, see the "Scripting" section at the [http://docs.sourcemod.net/ SourceMod Documentation], as well as [https://wiki.alliedmods.net/Scripting_FAQ_(SourceMod) Yak's FAQs on Scripting].<br />
<br />
[[Category:SourceMod Scripting]]<br />
<br />
{{LanguageSwitch}}</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=SourceMod&diff=11022SourceMod2020-06-04T03:45:56Z<p>Naleksuh: /* Future Plans */</p>
<hr />
<div>=Introduction=<br />
SourceMod is a [[SourceMM|Metamod:Source]] plugin for [[Half-Life 2]]. It provides comprehensive scripting for the Source engine and mods written using the Source SDK. It has features for administration systems, commands, console variables, events, network messages, timed actions, math and string routines, entity modification, and more. It also features a safely versioned, object oriented API usable from "extensions" written in C++. The extension API can be used to add scripting language callbacks and native features.<br />
<br />
SourceMod scripts are written in the SourcePawn language, which is derived from [[Pawn]]. Some of the differences include:<br />
*Passing functions as "objects," instead of by name<br />
*Natively packed and tagged strings<br />
*Dynamic local variables<br />
*A '<tt>decl</tt>' operator for creating uninitialized variables<br />
*A new virtual machine and JIT, both rewritten in C++<br />
*A new file format<br />
<br />
=History=<br />
==Initial Project==<br />
SourceMod was officially announced on October 7th, 2004, as a successor to [[AMX Mod X]] for the Half-Life 1 engine. It was targetted as a complete rewrite of AMX Mod X, with the following fundamental changes:<br />
*Use of multiple (pluggable) scripting languages<br />
*JavaScript support<br />
*Unloadability<br />
*An object-oriented module API<br />
<br />
The Source SDK was released on December 1st, 2004. A few weeks later, SourceMod released its source code on December 25th. Then, development began to stagnate. The concept of multiple languages was over-ambitious and improper. The system was largely too complex and too unorganized for developers to understand. Most importantly, the integral calling abstraction layer, designed to let Core talk to plugins without knowing the target scripting layer, was never viable. Because of this and the inherent complexity of MetaEng, scripts were not testable.<br />
<br />
By May of 2005, SourceMod had become completely abandoned. The codebase was scrapped for a rewrite, called "Core 2." This was also quickly abandoned. This timeline and the details therein are explained on the SourceMod [http://www.sourcemod.net/devlog/?p=88 Dev Log]. The remaining members of the SourceMod team went back to AMX Mod X.<br />
<br />
==SourceHook==<br />
By January of 2005, it was apparent that Valve's API would not be sufficient for plugin development in C++. SourceMod and AMX Mod X Developer Pavol "PM OnoTo" Marko started working on an API for safely hooking virtual functions via vtables. <br />
<br />
By March of 2005, it was apparent that this technology would be more useful as a separate project. Thus, SourceHook broke from SourceMod and the [[SourceMM|Metamod:Source]] project was started. Metamod:Source was first released on May 26, 2005.<br />
<br />
==Current Project==<br />
In March of 2006, a public survey was held to determine if the community still wanted SourceMod. Since the response was good, the project was restarted, but in secret, to avoid the same public relations mistakes. From March to September, SourcePawn was written, which included:<br />
*A new JIT, written completely in C++<br />
*A new virtual machine and API, written in C++ with object oriented API<br />
*A new file format<br />
*Various new language features<br />
<br />
From November 2006 to January 2007, SourceMod evolved into a usable scripting platform based on SourcePawn. As of March 16, 2007, it contained enough scripting-level features to be usable, and builds were made available to the public.<br />
<br />
SourceMod remains an ongoing development project which now runs on over 38% of all Source servers.<br />
<br />
=Development Team=<br />
*See the [http://www.sourcemod.net/credits.php credits page].<br />
<br />
=Future Plans=<br />
As of the time of writing, SourceMod version 1.10 has been released and version 1.11 is under development. The best way to keep up with current development of SourceMod is to view our news section of the forums (linked below).<br />
<br />
https://forums.alliedmods.net/forumdisplay.php?f=59<br />
<br />
=License=<br />
SourceMod along with it's extensions & plugins are all licensed under the [[GNU General Public License]].<br />
<br />
=See Also=<br />
*[[Introduction to SourcePawn]]<br />
*[[Introduction to SourceMod Plugins]]<br />
<br />
=External Links=<br />
*[http://www.sourcemod.net/ SourceMod Website]<br />
*[http://www.metamodsource.net/ Metamod:Source Website]<br />
<br />
[[Category:Half-Life_2]]<br />
[[Category:SourceMod]]</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=User:Naleksuh/common.css&diff=11021User:Naleksuh/common.css2020-06-04T02:04:34Z<p>Naleksuh: Created page with "#pt-darkmode-link a:before{content:'\263E'; display:inline-block}html{background-color:#000; }html #pt-darkmode-link a:before{content:'\263C'; }html,html img,html vide..."</p>
<hr />
<div>#pt-darkmode-link a:before{content:'\263E'; display:inline-block}html{background-color:#000; }html #pt-darkmode-link a:before{content:'\263C'; }html,html img,html video,html svg,html iframe,html .mw-no-invert,html .mw-mmv-overlay,html .mw-mmv-pre-image,html .mw-kartographer-map,html .mw-kartographer-mapDialog-map{filter:invert(1) hue-rotate(180deg);-webkit-filter:invert(1) hue-rotate(180deg)}html .toc,html .thumbinner,html #simpleSearch,html #searchInput,html #searchButton,html #searchGoButton,html table,html table.toccolours,html .wikitable,html .mw-notification{background-color:#dddddd}html body,html #mw-head,html #mw-panel,html #content.mw-body,html h1,html h2,html h3,html h4,html h5,html h6,html .toc,html div.thumbinner,html #simpleSearch,html #searchInput,html table.toccolours,html .mw-notification{border-color:#cdcbc8}html .thumbimage{border:0}html a,html #mw-panel .portal .body li a,html .toctogglelabel,html .mw-parser-output a.external,html .mw-parser-output a.extiw,html .mw-parser-output a.extiw:active{color:#6699ff}html a:visited,html #mw-panel .portal .body li a:visited{color:#709bbd}html a.new,html .new a{color:#ff6e6e}html .vectorTabs li a{color:#6699ff}html .infobox,html .infobox_v2{ background-color:#dddddd;border-color:#cdcbc8}html .ambox-content{background-color:#dddddd;border-color:#cdcbc8}<br />
<br />
/* Not stolen from Musikanimal */</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Commands_(SourceMod_Scripting)&diff=10998Commands (SourceMod Scripting)2020-04-29T16:26:40Z<p>Naleksuh: fix compile error</p>
<hr />
<div>[[SourceMod]] allows you to create console commands similar to [[AMX Mod X]]. There are two main types of console commands:<br />
*'''Server Commands''' - Fired from one of the following input methods:<br />
**the server console itself<br />
**the remote console (RCON)<br />
**the ServerCommand() function, either from SourceMod or the [[Half-Life 2]] engine<br />
*'''Console Commands''' - Fired from one of the following input methods:<br />
**a client's console<br />
**any of the server command input methods<br />
<br />
For server commands, there is no client index. For console/client commands, there is a client index, but it may be 0 to indicate that the command is from the server.<br />
<br />
Note that button-bound "commands," such as +attack and +duck, are not actually console commands. They are a separate command stream sent over the network, as they need to be tied to a specific frame. <br />
<br />
=Server Commands=<br />
As noted above, server commands are fired through the server console, whether remote, local, or through the Source engine. There is no client index associated with a server command. <br />
<br />
Server commands are registered through the <tt>RegServerCmd()</tt> function defined in <tt>console.inc</tt>. When registering a server command, you may be hooking an already existing command, and thus the return value is important.<br />
*<b><tt>Plugin_Continue</tt></b> - The original server command will be processed, if there was one. If the server command was created by a plugin, this has no effect.<br />
*<b><tt>Plugin_Handled</tt></b> - The original server command will not be processed, if there was one. If the server command was created by a plugin, this has no effect.<br />
*<b><tt>Plugin_Stop</tt></b> - The original server command will not be processed, if there was one. Additionally, no further hooks will be called for this command until it is fired again.<br />
<br />
==Adding Server Commands==<br />
Let's say we want to add a test command to show how Half-Life 2 breaks down command arguments. A possible implementation might be<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
RegServerCmd("test_command", Command_Test);<br />
}<br />
<br />
public Action Command_Test(int args)<br />
{<br />
char arg[128];<br />
char full[256];<br />
<br />
GetCmdArgString(full, sizeof(full));<br />
<br />
PrintToServer("Argument string: %s", full);<br />
PrintToServer("Argument count: %d", args);<br />
<br />
for (int i = 1; i <= args; i++)<br />
{<br />
GetCmdArg(i, arg, sizeof(arg));<br />
PrintToServer("Argument %d: %s", i, arg);<br />
}<br />
<br />
return Plugin_Handled;<br />
}<br />
</sourcepawn><br />
<br />
==Blocking Server Commands==<br />
Let's say we wanted to disable the "kickid" command on the server. There's no real good reason to do this, but for example's sake:<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
RegServerCmd("kickid", Command_KickId);<br />
}<br />
<br />
public Action Command_Kickid(int args)<br />
{<br />
return Plugin_Handled;<br />
}<br />
</sourcepawn><br />
<br />
=Console Commands=<br />
Unlike server commands, console commands can be triggered by either the server or the client, so the callback function receives a client index as well as the argument count. If the server fired the command, the client index will be 0. <br />
<br />
When returning the <tt>Action</tt> from the callback, the following effects will happen:<br />
*<tt>Plugin_Continue</tt>: The original functionality of the command (if any) will still be processed. If there was no original functionality, the client will receive "Unknown command" in their console.<br />
*<tt>Plugin_Handled</tt>: The original functionality of the command (if any) will be blocked. If there was no functionality originally, this prevents clients from seeing "Unknown command" in their console.<br />
*<tt>Plugin_Stop</tt>: Same as <tt>Plugin_Handled</tt>, except that this will be the last hook called.<br />
*<tt>Plugin_Changed</tt>: Inputs or outputs have been overridden with new values.<br />
<br />
Note that, unlike AMX Mod X, SourceMod does not allow you to register command filters. I.e., there is no equivalent to this notation:<br />
<sourcepawn>register_clcmd("say /ff", "Command_SayFF");</sourcepawn><br />
<br />
This notation was removed to make our internal code simpler and faster. Writing the same functionality is easy, and demonstrated below.<br />
<br />
==Adding Commands==<br />
Adding client commands is very simple. Let's port our earlier testing command to display information about the client as well.<br />
<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
RegConsoleCmd("test_command", Command_Test);<br />
}<br />
<br />
public Action Command_Test(int client, int args)<br />
{<br />
char arg[128];<br />
char full[256];<br />
<br />
GetCmdArgString(full, sizeof(full));<br />
<br />
if (client)<br />
{<br />
PrintToServer("Command from client: %N", client);<br />
}<br />
else<br />
{<br />
PrintToServer("Command from server.");<br />
}<br />
<br />
PrintToServer("Argument string: %s", full);<br />
PrintToServer("Argument count: %d", args);<br />
<br />
for (int i = 1; i <= args; i++)<br />
{<br />
GetCmdArg(i, arg, sizeof(arg));<br />
PrintToServer("Argument %d: %s", i, arg);<br />
}<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
==Hooking Commands==<br />
A common example is hooking the say command. Let's say we want to tell players whether FF is enabled when they say '/ff' in game. <br />
<br />
Before we implement this, a common point of confusion with the 'say' command is that Half-Life 2 (and Half-Life 1), by default, send it with the text in one big quoted string. This means if you say "I like hot dogs," your command will be broken down as such:<br />
*Argument string: "I like hot dogs"<br />
*Argument count: 1<br />
*Argument #1: I like hot dogs<br />
<br />
However, if a player types this in their console: <tt>say I like yams</tt>, it will be broken up as:<br />
*Argument string: I like yams<br />
*Argument count: 3<br />
*Argument #1: I<br />
*Argument #2: like<br />
*Argument #3: yams<br />
<br />
<sourcepawn>ConVar g_cvarFF = null;<br />
<br />
public void OnPluginStart()<br />
{<br />
g_cvarFF = FindConVar("mp_friendlyfire");<br />
}<br />
<br />
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)<br />
{<br />
if (strcmp(sArgs, "ff", false) == 0)<br />
{<br />
if (g_cvarFF != null)<br />
{<br />
if (g_cvarFF.BoolValue)<br />
{<br />
PrintToChat(client, "Friendly fire is enabled.");<br />
} <br />
else <br />
{<br />
PrintToChat(client, "Friendly fire is disabled.");<br />
}<br />
<br />
/* Block the client's messsage from broadcasting */<br />
return Plugin_Handled;<br />
}<br />
}<br />
<br />
/* Let say continue normally */<br />
return Plugin_Continue;<br />
}</sourcepawn><br />
<br />
Here we use the OnClientSayCommand forward where as <tt>command</tt> contains the type (example: <tt>say</tt> or <tt>say_team</tt>) and <tt>sArgs</tt> containing the users input<br />
<br />
==Creating Admin Commands==<br />
Let's create a simple admin command which kicks another player by their full name. <br />
<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
RegAdminCmd("admin_kick", Command_Kick, ADMFLAG_KICK, "Kicks a player by name");<br />
}<br />
<br />
public Action Command_Kick(int client, int args)<br />
{<br />
if (args < 1)<br />
{<br />
PrintToConsole(client, "Usage: admin_kick <name>");<br />
return Plugin_Handled;<br />
}<br />
<br />
char name[32];<br />
int target = -1;<br />
GetCmdArg(1, name, sizeof(name));<br />
<br />
for (int i = 1; i <= MaxClients; i++)<br />
{<br />
if (!IsClientConnected(i))<br />
{<br />
continue;<br />
}<br />
<br />
char other[32];<br />
GetClientName(i, other, sizeof(other));<br />
<br />
if (StrEqual(name, other))<br />
{<br />
target = i;<br />
}<br />
}<br />
<br />
if (target == -1)<br />
{<br />
PrintToConsole(client, "Could not find any player with the name: \"%s\"", name);<br />
return Plugin_Handled;<br />
}<br />
<br />
KickClient(target);<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
==Immunity==<br />
In our previous example, we did not take immunity into account. Immunity is a much more complex system in SourceMod than it was in AMX Mod X, and there is no simple flag to denote its permissions. Instead, two functions are provided:<br />
*<tt>CanAdminTarget</tt>: Tests raw AdminId values for immunity.<br />
*<tt>CanUserTarget</tt>: Tests in-game clients for immunity.<br />
<br />
While immunity is generally tested ''player versus player'', it is possible you might want to check for immunity and not have a targetting client. While there is no convenience function for this yet, a good idea might be to check for either ''default'' or ''global'' immunity on the player's groups (these can be user-defined for non-player targeted scenarios).<br />
<br />
When checking for immunity, the following heuristics are performed in this exact order:<br />
<ol><li>If the targeting AdminId is <tt>INVALID_ADMIN_ID</tt>, targeting fails.</li><br />
<li>If the targetted AdminId is <tt>INVALID_ADMIN_ID</tt>, targeting succeeds.</li><br />
<li>If the targeting admin has <tt>Admin_Root</tt> (<tt>ADMFLAG_ROOT</tt>), targeting succeeds.</li><br />
<li>If the targetted admin has global immunity, targeting fails.</li><br />
<li>If the targetted admin has default immunity, and the targeting admin belongs to no groups, targeting fails.</li><br />
<li>If the targetted admin has specific immunity from the targeting admin via group immunities, targeting fails.</li><br />
<li>If no conclusion is reached via the previous steps, targeting succeeds.</li><br />
</ol><br />
<br />
So, how can we adapt our function about to use immunity?<br />
<br />
<sourcepawn>public Action Command_Kick(int client, int args)<br />
{<br />
if (args < 1)<br />
{<br />
PrintToConsole(client, "Usage: admin_kick <name>");<br />
return Plugin_Handled;<br />
}<br />
<br />
char name[32];<br />
int target = -1;<br />
GetCmdArg(1, name, sizeof(name));<br />
<br />
for (int i = 1; i <= MaxClients; i++)<br />
{<br />
if (!IsClientConnected(i))<br />
{<br />
continue;<br />
}<br />
<br />
char other[32];<br />
GetClientName(i, other, sizeof(other));<br />
<br />
if (StrEqual(name, other))<br />
{<br />
target = i;<br />
}<br />
}<br />
<br />
if (target == -1)<br />
{<br />
PrintToConsole(client, "Could not find any player with the name: \"%s\"", name);<br />
return Plugin_Handled;<br />
}<br />
<br />
if (!CanUserTarget(client, target))<br />
{<br />
PrintToConsole(client, "You cannot target this client.");<br />
return Plugin_Handled;<br />
}<br />
<br />
KickClient(target);<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
=Client-Only Commands=<br />
SourceMod exposes a forward that is called whenever a client executes any command string in their console, called <tt>OnClientCommand</tt>. An example of this looks like:<br />
<br />
<sourcepawn>public Action OnClientCommand(int client, int args)<br />
{<br />
char cmd[16];<br />
GetCmdArg(0, cmd, sizeof(cmd)); /* Get command name */<br />
<br />
if (StrEqual(cmd, "test_command"))<br />
{<br />
/* Got the client command! Block it... */<br />
return Plugin_Handled;<br />
}<br />
<br />
return Plugin_Continue;<br />
}</sourcepawn><br />
<br />
It is worth noting that not everything a client sends will be available through this command. Command registered via external sources in C++ may not be available, especially if they are created via <tt>CON_COMMAND</tt> in the game mod itself. For example, "say" is usually implemented this way, because it can be used by both clients and the server, and thus it does not channel through this forward.<br />
<br />
<br />
=Chat Triggers=<br />
SourceMod will automatically create chat triggers for every command you make. For example, if you create a console command called <tt>"sm_megaslap"</tt>, administrators will be able to type any of the following commands in <tt>say</tt>/<tt>say_team</tt> message modes:<br />
<pre>!sm_megaslap<br />
!megaslap<br />
/sm_megaslap<br />
/megaslap</pre><br />
<br />
SourceMod then executes this command and its arguments as if it came from the client console.<br />
*"<tt>!</tt>" is the default ''public'' trigger (<tt>PublicChatTrigger</tt> in <tt>configs/core.cfg</tt>) and your entry will be displayed to all clients as normal.<br />
*"<tt>/</tt>" is the default ''silent'' trigger (<tt>SilentChatTrigger</tt> in <tt>configs/core.cfg</tt>) and your entry will be blocked from being displayed.<br />
<br />
SourceMod will only execute commands registered with <tt>RegConsoleCmd</tt> or <tt>RegAdminCmd</tt>, and only if those commands are not already provided by Half-Life 2 or the game mod. If the command is prefixed with "sm_" then the "sm_" can be omitted from the chat trigger.<br />
<br />
Console commands which wish to support usage as a chat trigger should not use <tt>PrintTo*</tt> natives. Instead, they should use <tt>ReplyToCommand()</tt>, which will automatically print your message either as a chat message or to the client's console, depending on the source of the command.<br />
<br />
[[Category:SourceMod Scripting]]<br />
<br />
{{LanguageSwitch}}</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=SDKHooks&diff=10994SDKHooks2020-04-07T23:20:03Z<p>Naleksuh: /* Regarding SDKHook_OnTakeDamage and SDKHook_OnTakeDamageAlive */</p>
<hr />
<div>==Introduction==<br />
SDKHooks was previously an external extension to Sourcemod. It was rolled in [https://wiki.alliedmods.net/Sourcemod_1.5.0_API_Changes#SDKHooks Sourcemod 1.5] and it does not need to be manually installed anymore.<br />
<br />
==Hooks==<br />
Some information on various hooks below.<br />
<br />
===SDKHook_OnTakeDamage===<br />
inflictor (3rd argument) is the entity that inflicts the damage. If a player directly damages another, inflictor should be equal to the attacking player id. An example of an indirect damage would be a grenade.<br />
<br />
===SDKHook_OnTakeDamageAlive===<br />
This hook works in a similar way to SDKHook_OnTakeDamage but it gives the [https://bugs.alliedmods.net/show_bug.cgi?id=6249#c7 actual, calculated damage amount done to the player. The pre-hook will fire after an OnTakeDamage pre-hook, and the post-hook will fire before an OnTakeDamage post-hook. The health is subtracted in between pre and post unless the hook is blocked.] {{pr|149}}<br />
<br />
[https://forums.alliedmods.net/showthread.php?p=2309798#post2309798 OnTakeDamageAlive is also only called for players.]<br />
<br />
==Under CSS==<br />
===Non-regular cases for SDKHook_OnTakeDamage===<br />
In the scenario where a player throw a grenade to another player then quickly disconnect, the attacker (2nd argument) will become the inflictor (3rd argument). <br />
<br />
In the scenario where a player fall; the attacker, which is also the inflictor, will be 0 (the world).<br />
<br />
In the scenario where a terrorist plants the bomb, when the bomb explodes, the attacker (2nd argument) will be the same as the inflictor (3rd argument) which will have the Classname "planted_c4".<br />
<br />
===Some damage types===<br />
A normal HEGrenade and the C4 inflict damage of type DMG_BLAST.<br />
<br />
A fall inflicts damage of type DMG_FALL.<br />
<br />
A grenade impact (for instance a flash hitting a teammate) will inflict damage of type DMG_CLUB.<br />
<br />
A normal gun bullet and the knife will inflict damage of type (DMG_BULLET | DMG_NEVERGIB) (non-headshot) or (DMG_BULLET | DMG_NEVERGIB | (1 << 30) ) (headshot).<br />
<br />
A single attack can trigger many SDKHook_OnTakeDamage; when a gun throws pullets for instance (shotgun and glock in burst-mode notably).<br />
<br />
<br />
(Regarding SM/Admin damaged; maybe place this is another section if someone can be sure that this would occur on all mods)<br />
<br />
sm_slap does not trigger SDKHook_OnTakeDamage.<br />
<br />
sm_burn will trigger two different callback : an entity with the classname "entityflame" will deal once 0 damage of type DMG_BURN and once 1 damage of type (DMG_BURN | DMG_DIRECT) every tick.<br />
<br />
===Regarding SDKHook_OnTakeDamage and SDKHook_OnTakeDamageAlive===<br />
<br />
SDKHook_OnTakeDamage/Post is triggered when hitting a teammate with mp_friendlyfire 0 (except in TF2), but not SDKHook_OnTakeDamageAlive.<br />
<br />
==Under TF2==<br />
Under tf2, the "normal" takedamage hook isn't 100% accurate, it's damage param is the weapon's base damage. the DMG_CRIT flag is for both crit and minicrit, spread and minicrit/crit damage is done after this call.<br />
<br />
The modified crit damage is available in SDKHook_OnTakeDamageAlive/Post.<br />
<br />
===Some damage types===<br />
Shotgun = DMG_BUCKSHOT | DMG_SLOWBURN<br />
<br />
Rocket Launcher = DMG_SLOWBURN | DMG_RADIATION | DMG_BLAST<br />
<br />
If a crit, |= DMG_CRIT</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Introduction_to_SourceMod_Plugins&diff=10990Introduction to SourceMod Plugins2020-03-30T15:36:51Z<p>Naleksuh: /* Implementation */ improve upon formatting instead of redundant GetClientName</p>
<hr />
<div>This guide will give you a basic introduction to writing a [[SourceMod]] plugin. If you are not familiar with the SourcePawn language, it is recommended that you at least briefly read the [[Introduction to SourcePawn]] article.<br />
<br />
For information on compiling plugins, see [[Compiling SourceMod Plugins]]. You can use [https://forums.alliedmods.net/showthread.php?t=259917 SPEdit], [https://www.crimsoneditor.com/ Crimson Editor], [http://www.pspad.com/ PSPad], [http://www.ultraedit.com/ UltraEdit], [https://notepad-plus-plus.org/ Notepad++], [https://www.textpad.com/ TextPad], [http://sourceforge.net/projects/pawnstudio/ Pawn Studio], [https://forums.alliedmods.net/showthread.php?t=289127 BasicPawn] or any other text editor you're comfortable with to write plugins.<br />
<br />
=Starting from scratch=<br />
Open your favorite text editor and create a new empty file. When you have an empty file you can just start writing code using the core language, however, you will not be able to use any of SourceMod features because the compiler does not know about them. This is done deliberately so it is possible to use SourcePawn outside of SourceMod. But since we are writing a SourceMod plugin, it is a good idea to enable access to SourceMod features first. This is done using <tt>#include</tt> directive. It tells the compiler to "paste" the code from another file into yours.<br />
<pawn>#include <sourcemod></pawn><br />
How does this work? First of all, note that we enclosed file name into angle brackets. Angle brackets tell the compiler to look in the default include directory. By default, it is '''scripting/include'''. You can open it right now and see a lot of inc files there. Those are SourceMod include files that describe various functions, tags and other features available for SourceMod plugins. The files are plain-text and you are encouraged to read them. You will notice, however, that there's not much code in there, certainly not enough to implement all the great features of SourceMod, so where are they? They are implemented inside a SourceMod core which is written in C++ and is compiled into binary files which end up in '''bin''' directory. So how does your SourcePawn code and SM core link together if the compiler doesn't know about the existence of the latter? SourceMod include files are written specially, so they say that the implementation of functions is ''somewhere else''. The compiler understands that and generates a special code that says that this function call is going outside. When SourceMod loads your plugin, it inspects these bits of code and substitutes it's own internal functions instead. This is called [http://en.wikipedia.org/wiki/Dynamic_linking dynamic linking].<br />
<br />
=Setting up plugin info=<br />
Now that we got access to SourceMod features, it is time to set up the information that will be displayed via <tt>sm plugins list</tt> command. No one likes unnamed plugins. To do that we are going to look inside '''sourcemod.inc''' file and see the format that information should be declared. It's always helpful to look inside SM include files to find out information you don't know. There is also an [http://docs.sourcemod.net/api/ API documentation] but it can be outdated and it only has SM core files so if your plugin is going to use any third party extension or another plugin, you will have to study inc files. So, open '''sourcemod.inc''' and scroll down a bit until you see this:<br />
<sourcepawn>/**<br />
* Plugin public information.<br />
*/<br />
struct Plugin<br />
{<br />
public const char[] name; /**< Plugin Name */<br />
public const char[] description; /**< Plugin Description */<br />
public const char[] author; /**< Plugin Author */<br />
public const char[] version; /**< Plugin Version */<br />
public const char[] url; /**< Plugin URL */<br />
};</sourcepawn><br />
and this:<br />
<sourcepawn>/**<br />
* Declare this as a struct in your plugin to expose its information.<br />
* Example:<br />
*<br />
* public Plugin myinfo =<br />
* {<br />
* name = "My Plugin",<br />
* //etc<br />
* };<br />
*/<br />
public Plugin myinfo;</sourcepawn><br />
<br />
It tells us that we need to create a global public variable <tt>myinfo</tt> which must be of type <tt>Plugin</tt> which is a struct with 5 fields which themselves are strings. It may sound complicated for a beginner but it's easy. Let's go ahead and create one:<br />
<sourcepawn>public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};</sourcepawn><br />
<br />
The <tt>public</tt> keyword means that SourceMod will be able to directly access our variable. <tt>Plugin:</tt> defines a type of our variable. <tt>myinfo</tt> is, obviously, a name of our variable as required by SourceMod. You see that we initialize it right away. This is the preferable way to fill out plugin info.<br />
<br />
After that the full code of your plugin should look like this:<br />
<sourcepawn>#include <sourcemod><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};</sourcepawn><br />
<br />
=Getting code to run=<br />
We already include SourceMod features and filled up or plugin info. We now have a perfectly well-formed plugin which can be compiled and loaded by SourceMod. However, there is one problem - it does nothing. You might be tempted to just start writing a code after <tt>myinfo</tt> declaration just to see that it will not compile. SourcePawn, unlike other scripting languages like Lua, does not allow a code to be outside of functions. After reading that, you may probably want to just define some function, name it <tt>main</tt> probably, compile and load a plugin and see that your code never gets called. So how do we make SourceMod call our code? For this exact reason, we have forwards. Forwards are function prototypes declared by one party that can be implemented by another party as a [http://en.wikipedia.org/wiki/Callback_%28computer_programming%29 callback]. When a first party starts a forward call, all parties that have matching callbacks receive the call. SourceMod declares a plenty of interesting forwards that we can implement. As you can see, forwards are the only way to get our code executed, keep that in mind. So let's implement <tt>OnPluginStart</tt> forward. As you may have guessed, it is called when our plugin starts. To do that, we'll have to look up the declaration of <tt>OnPluginStart</tt>. It is declared inside '''sourcemod.inc''', a file we are already familiar with, let's find it:<br />
<sourcepawn>/**<br />
* Called when the plugin is fully initialized and all known external references <br />
* are resolved. This is only called once in the lifetime of the plugin, and is <br />
* paired with OnPluginEnd().<br />
*<br />
* If any run-time error is thrown during this callback, the plugin will be marked <br />
* as failed.<br />
*<br />
* It is not necessary to close any handles or remove hooks in this function. <br />
* SourceMod guarantees that plugin shutdown automatically and correctly releases <br />
* all resources.<br />
*<br />
* @noreturn<br />
*/<br />
forward void OnPluginStart();</sourcepawn><br />
Empty parentheses tell us that no arguments are passed inside this forward, <tt>@noreturn</tt> inside documentation tells us that we don't have to return anything, pretty simple forward. So how to write a correct callback for it? Firstly, our callback must have the same name, so it's <tt>OnPluginStart</tt>, secondly, our callback should have the same number of arguments, none in this case, and lastly, SourceMod needs to be able to call our callback so it needs to be <tt>public</tt>. So the implementation looks like this:<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
}</sourcepawn><br />
<br />
Now we can write code inside curly braces and it will be executed when our plugin starts. Let's output <tt>"Hello world!"</tt> to server console. To do that we are going to use <tt>PrintToServer</tt> function. It is declared inside '''console.inc''', however, we don't need to manually include '''console.inc''' because it is included automatically as part of '''sourcemod.inc'''.<br />
<sourcepawn>/**<br />
* Sends a message to the server console.<br />
*<br />
* @param format Formatting rules.<br />
* @param ... Variable number of format parameters.<br />
* @noreturn<br />
*/<br />
native int PrintToServer(const char[] format, any ...);</sourcepawn><br />
As you can see, this is a native function. It is implemented inside SM core. Judging by it's arguments, we can see that it is a [[Format_Class_Functions_%28SourceMod_Scripting%29|format class function]]. However, we don't need any formatting right now, so let's just pass <tt>"Hello world!"</tt> string as an only argument:<br />
<sourcepawn>public void OnPluginStart()<br />
{<br />
PrintToServer("Hello world!");<br />
}</sourcepawn><br />
That's it! The full code of your plugin should look like this:<br />
<sourcepawn>#include <sourcemod><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0",<br />
url = "http://www.sourcemod.net/"<br />
};<br />
<br />
public void OnPluginStart()<br />
{<br />
PrintToServer("Hello world!");<br />
}</sourcepawn><br />
Compile and load your plugin on your server and see for yourself that the message is displayed in the server console.<br />
<br />
=Includes=<br />
Pawn requires '''include files''', much like C requires header files. Include files list all of the structures, functions, callbacks, and tags that are available. There are three types of include files:<br />
*'''Core''' - <tt>sourcemod.inc</tt> and anything it includes. These are all provided by SourceMod's Core.<br />
*'''Extension''' - adds a dependency against a certain extension.<br />
*'''Plugin''' - adds a dependency against a certain plugin.<br />
<br />
Include files are loaded using the <tt>#include</tt> compiler directive.<br />
<br />
=Commands=<br />
Our first example will be writing a simple admin command to slap a player. We'll continue to extend this example with more features until we have a final, complete result.<br />
<br />
==Declaration==<br />
First, let's look at what an admin command requires. Admin commands are registered using the [https://sm.alliedmods.net/new-api/console/RegAdminCmd RegAdminCmd] function. They require a '''name''', a '''callback function''', and '''default admin flags'''. <br />
<br />
The callback function is what's invoked every time the command is used. [https://sm.alliedmods.net/new-api/console/ConCmd Click here] to see its prototype. Example:<br />
<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
}</sourcepawn><br />
<br />
Now we've successfully implemented a command -- though it doesn't do anything yet. In fact, it will say "Unknown command" if you use it! This is because you're not returning Plugin_Handled in your callback. Since you haven't, SourceMod believes you didn't want the Source Engine to know the command was registered, and it handles it so. The reason SourceMod expects your function to return Plugin_Handled is because of the Action tag you put in your function's prototype. The Action tag specifies that Command_MySlap must return one of four things. See the [https://sm.alliedmods.net/new-api/core/Action Action] enumeration in the sourcemod API to learn more about these return types and when to use them.<br />
<br />
<sourcepawn>public Action Command_MySlap(int client, int args)<br />
{<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
Now the command will report no error, but it still won't do anything. This is because returning "Plugin_Handled" in a command callback will prevent the engine from processing the command. The engine will never even see that the command was run. This is what you will want to do if you are registering a completely new command through SourceMod.<br />
<br />
==Implementation==<br />
Let's decide what the command will look like. Let's have it act like the default <tt>sm_slap</tt> command:<br />
<pre>sm_myslap <name|#userid> [damage]</pre><br />
<br />
To implement this, we'll need a few steps:<br />
*Get the input from the console. For this we use [https://sm.alliedmods.net/new-api/console/GetCmdArg GetCmdArg()].<br />
*Find a matching player. For this we use [https://sm.alliedmods.net/new-api/helpers/FindTarget FindTarget()].<br />
*Slap them. For this we use [https://sm.alliedmods.net/new-api/sdktools_functions/SlapPlayer SlapPlayer()], which requires including <tt>sdktools</tt>, an extension bundled with SourceMod.<br />
*Respond to the admin. For this we use [https://sm.alliedmods.net/new-api/console/ReplyToCommand ReplyToCommand()].<br />
<br />
Full example:<br />
<br />
<sourcepawn><br />
#include <sourcemod><br />
#include <sdktools><br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0.0.0",<br />
url = "http://www.sourcemod.net/"<br />
}<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
LoadTranslations("common.phrases.txt"); // Required for FindTarget fail reply<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
<br />
/* By default, we set damage = 0 */<br />
int damage = 0;<br />
<br />
/* Get the first argument */<br />
GetCmdArg(1, arg1, sizeof(arg1));<br />
<br />
/* If there are 2 or more arguments, we set damage to<br />
* what the user specified. If a damage isn't specified<br />
* then it will stay zero. */<br />
if (args >= 2)<br />
{<br />
GetCmdArg(2, arg2, sizeof(arg2));<br />
damage = StringToInt(arg2);<br />
}<br />
<br />
/* Try and find a matching player */<br />
int target = FindTarget(client, arg1);<br />
if (target == -1)<br />
{<br />
/* FindTarget() automatically replies with the <br />
* failure reason and returns -1 so we know not <br />
* to continue<br />
*/<br />
return Plugin_Handled;<br />
}<br />
<br />
SlapPlayer(target, damage);<br />
ReplyToCommand(client, "[SM] You slapped %N for %d damage!", target, damage);<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
For more information on what %N and %d are, see [[Format Class Functions (SourceMod Scripting)|Format Class Functions]]. Note that you never need to unregister or remove your admin command. When a plugin is unloaded, SourceMod cleans it up for you.<br />
<br />
=ConVars=<br />
ConVars, also known as cvars, are global console variables in the Source engine. They can have integer, float, or string values. ConVar accessing is done through [[Handles (SourceMod Scripting)|Handles]]. Since ConVars are global, you do not need to close ConVar Handles (in fact, you cannot).<br />
<br />
The handy feature of ConVars is that they are easy for users to configure. They can be placed in any .cfg file, such as <tt>server.cfg</tt> or <tt>sourcemod.cfg</tt>. To make this easier, SourceMod has an [https://sm.alliedmods.net/new-api/sourcemod/AutoExecConfig AutoExecConfig()] function. This function will automatically build a default .cfg file containing all of your cvars, annotated with comments, for users. It is highly recommended that you call this if you have customizable ConVars.<br />
<br />
Let's extend your example from earlier with a new ConVar. Our ConVar will be <tt>g_cvarMySlapDamage</tt> and will specify the default damage someone is slapped for if no damage is specified.<br />
<br />
<sourcepawn>ConVar g_cvarMySlapDamage = null;<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
<br />
g_cvarMySlapDamage = CreateConVar("sm_myslap_damage", "5", "Default slap damage");<br />
AutoExecConfig(true, "plugin_myslap");<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
int damage = g_cvarMySlapDamage.IntValue;<br />
<br />
/* The rest remains unchanged! */<br />
</sourcepawn><br />
<br />
=Showing Activity, Logging=<br />
Almost all admin commands should log their activity, and some admin commands should show their activity to in-game clients. This can be done via the [https://sm.alliedmods.net/new-api/logging/LogAction LogAction()] and [https://sm.alliedmods.net/new-api/console/ShowActivity2 ShowActivity2()] functions. The exact functionality of ShowActivity2() is determined by the <tt>sm_show_activity</tt> cvar.<br />
<br />
For example, let's rewrite the last few lines of our slap command:<br />
<sourcepawn><br />
SlapPlayer(target, damage);<br />
<br />
char name[MAX_NAME_LENGTH];<br />
<br />
GetClientName(target, name, sizeof(name));<br />
<br />
ShowActivity2(client, "[SM] ", "Slapped %s for %d damage!", name, damage);<br />
LogAction(client, target, "\"%L\" slapped \"%L\" (damage %d)", client, target, damage);<br />
<br />
return Plugin_Handled;<br />
}<br />
</sourcepawn><br />
<br />
=Multiple Targets=<br />
To fully complete our slap demonstration, let's make it support multiple targets. SourceMod's [[Admin_Commands_%28SourceMod%29#How_to_Target|targeting system]] is quite advanced, so using it may seem complicated at first. <br />
<br />
The function we use is [https://sm.alliedmods.net/new-api/commandfilters/ProcessTargetString ProcessTargetString()]. It takes in input from the console and returns a list of matching clients. It also returns a noun that will identify either a single client or describe a list of clients. The idea is that each client is then processed, but the activity shown to all players is only processed once. This reduces screen spam.<br />
<br />
This method of target processing is used for almost every admin command in SourceMod, and in fact, FindTarget() is just a simplified version.<br />
<br />
Full, final example:<br />
<sourcepawn><br />
#include <sourcemod><br />
#include <sdktools><br />
<br />
ConVar g_cvarMySlapDamage = null;<br />
<br />
public Plugin myinfo =<br />
{<br />
name = "My First Plugin",<br />
author = "Me",<br />
description = "My first plugin ever",<br />
version = "1.0.0.0",<br />
url = "http://www.sourcemod.net/"<br />
}<br />
<br />
public void OnPluginStart()<br />
{<br />
RegAdminCmd("sm_myslap", Command_MySlap, ADMFLAG_SLAY);<br />
LoadTranslations("common.phrases.txt");<br />
<br />
g_cvarMySlapDamage = CreateConVar("sm_myslap_damage", "5", "Default slap damage");<br />
AutoExecConfig(true, "plugin_myslap");<br />
}<br />
<br />
public Action Command_MySlap(int client, int args)<br />
{<br />
char arg1[32], arg2[32];<br />
int damage = g_cvarMySlapDamage.IntValue;<br />
<br />
/* Get the first argument */<br />
GetCmdArg(1, arg1, sizeof(arg1));<br />
<br />
/* If there are 2 or more arguments, and the second argument fetch <br />
* is successful, convert it to an integer.<br />
*/<br />
if (args >= 2 && GetCmdArg(2, arg2, sizeof(arg2)))<br />
{<br />
damage = StringToInt(arg2);<br />
}<br />
<br />
/**<br />
* target_name - stores the noun identifying the target(s)<br />
* target_list - array to store clients<br />
* target_count - variable to store number of clients<br />
* tn_is_ml - stores whether the noun must be translated<br />
*/<br />
char target_name[MAX_TARGET_LENGTH];<br />
int target_list[MAXPLAYERS], target_count;<br />
bool tn_is_ml;<br />
<br />
if ((target_count = ProcessTargetString(<br />
arg1,<br />
client,<br />
target_list,<br />
MAXPLAYERS,<br />
COMMAND_FILTER_ALIVE, /* Only allow alive players */<br />
target_name,<br />
sizeof(target_name),<br />
tn_is_ml)) <= 0)<br />
{<br />
/* This function replies to the admin with a failure message */<br />
ReplyToTargetError(client, target_count);<br />
return Plugin_Handled;<br />
}<br />
<br />
for (int i = 0; i < target_count; i++)<br />
{<br />
SlapPlayer(target_list[i], damage);<br />
LogAction(client, target_list[i], "\"%L\" slapped \"%L\" (damage %d)", client, target_list[i], damage);<br />
}<br />
<br />
if (tn_is_ml)<br />
{<br />
ShowActivity2(client, "[SM] ", "Slapped %t for %d damage!", target_name, damage);<br />
}<br />
else<br />
{<br />
ShowActivity2(client, "[SM] ", "Slapped %s for %d damage!", target_name, damage);<br />
}<br />
<br />
return Plugin_Handled;<br />
}</sourcepawn><br />
<br />
=Events=<br />
Events are informational notification messages passed between objects in the server. Many are also passed from the server to the client. They are defined in .res files under the <tt>hl2/resource</tt> folder and <tt>resource</tt> folders of specific mods. For a basic listing, see [[Game Events (Source)|Source Game Events]].<br />
<br />
It is important to note a few concepts about events:<br />
*They are almost always informational. That is, blocking <tt>player_death</tt> will not stop a player from dying. It may block a HUD or console message or something else minor.<br />
*They almost always use userids instead of client indexes.<br />
*Just because it is in a resource file does not mean it is ever called, or works the way you expect it to. Mods are notorious for not properly documenting their event functionality.<br />
<br />
An example of finding when a player dies:<br />
<sourcepawn><br />
public void OnPluginStart()<br />
{<br />
HookEvent("player_death", Event_PlayerDeath);<br />
}<br />
<br />
public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)<br />
{<br />
int victim_id = event.GetInt("userid");<br />
int attacker_id = event.GetInt("attacker");<br />
<br />
int victim = GetClientOfUserId(victim_id);<br />
int attacker = GetClientOfUserId(attacker_id);<br />
<br />
/* CODE */<br />
}</sourcepawn><br />
<br />
=Callback Orders and Pairing=<br />
SourceMod has a number of builtin callbacks about the state of the server and plugin. Some of these are paired in special ways which can confuse users.<br />
<br />
==Pairing==<br />
'''Pairing''' is SourceMod terminology. Examples of it are:<br />
*OnMapEnd() cannot be called without an OnMapStart(), and if OnMapStart() is called, it cannot be called again without an OnMapEnd().<br />
*OnClientConnected(N) for a given client N will only be called once until an OnClientDisconnected(N) for the same client N is called (which is guaranteed to happen).<br />
<br />
There is a formal definition of SourceMod's pairing. For two functions X and Y, both with input A, the following conditions hold:<br />
*If X is invoked with input A, it cannot be invoked again with the same input unless Y is called with input A.<br />
*If X is invoked with input A, it is guaranteed that Y will, at some point, be called with input A.<br />
*Y cannot be invoked with any input A unless X was called first with input A.<br />
*The relationship is described as, "X is paired with Y," and "Y is paired to X."<br />
<br />
==General Callbacks==<br />
These callbacks are listed in the order they are called, in the lifetime of a plugin and the server.<br />
<br />
*[https://sm.alliedmods.net/new-api/sourcemod/AskPluginLoad2 AskPluginLoad2()] - Called once, immediately after the plugin is loaded from the disk. This function can be used to stop a plugin from loading and return a custom error message; return APLRes_Failure and use strcopy on to replace the error string. All CreateNative and RegPluginLibrary calls should be done here. <br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnPluginStart OnPluginStart()] - Called once, after the plugin has been fully initialized and can proceed to load. Any run-time errors in this function will cause the plugin to fail to load. '''This is paired with OnPluginEnd()'''.<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnAllPluginsLoaded OnAllPluginsLoaded()] - Called once, after all non-late loaded plugins have called OnPluginStart. <br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnMapStart OnMapStart()] - Called every time the map loads. If the plugin is loaded late, and the map has already started, this function is called anyway after load, in order to preserve pairing. '''This function is paired with OnMapEnd().'''<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnConfigsExecuted OnConfigsExecuted()] - Called once per map-change after <tt>servercfgfile</tt> (usually <tt>server.cfg</tt>), <tt>sourcemod.cfg</tt>, and all plugin config files have finished executing. If a plugin is loaded after this has happened, the callback is called anyway, in order to preserve pairing. '''This function is paired with OnMapEnd().'''<br />
*At this point, most game callbacks can occur, such as events and callbacks involving clients (or other things, like OnGameFrame).<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnMapEnd OnMapEnd()] - Called when the map is about to end. At this point, all clients are disconnected, but <tt>TIMER_NO_MAPCHANGE</tt> timers are not yet destroyed. '''This function is paired to OnMapStart().'''<br />
*[https://sm.alliedmods.net/new-api/sourcemod/OnPluginEnd OnPluginEnd()] - Called once, immediately before the plugin is unloaded. '''This function is paired to OnPluginStart().'''<br />
<br />
==Client Callbacks==<br />
These callbacks are listed in no specific order, however, their documentation holds for both fake and real clients.<br />
<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientConnect OnClientConnect()] - Called when a player initiates a connection. You can block a player from connecting by returning Plugin_Stop and setting rejectmsg to an error message.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientConnected OnClientConnected()] - Called after a player connects. Signifies that the player is in-game and IsClientConnected() will return true. '''This is paired with OnClientDisconnect() for successful connections only.'''<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientAuthorized OnClientAuthorized()] - Called when a player gets a Steam ID. It is important to note that this may never be called. It may occur any time in between OnClientConnected and OnClientPreAdminCheck/OnClientDisconnect. Do not rely on it unless you are writing something that needs Steam IDs, and even then you should use OnClientPostAdminCheck().<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientPutInServer OnClientPutInServer()] - Signifies that the player is in-game and IsClientInGame() will return true.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientPostAdminCheck OnClientPostAdminCheck()] - Called after the player is '''both authorized and in-game'''. This is the best callback for checking administrative access after connect.<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientDisconnect OnClientDisconnect()] - Called when a player's disconnection starts. '''This is paired to OnClientConnected().'''<br />
*[https://sm.alliedmods.net/new-api/clients/OnClientDisconnect_Post OnClientDisconnect_Post()] - Called when a player's disconnection ends. '''This is paired to OnClientConnected().'''<br />
<br />
=Frequently Asked Questions=<br />
==Are plugins reloaded every mapchange?==<br />
Plugins, by default, are not reloaded on mapchange unless their timestamp changes. This is a feature so plugin authors have more flexibility with the state of their plugins. <br />
<br />
==Do I need to call CloseHandle in OnPluginEnd?==<br />
No. SourceMod automatically closes your Handles when your plugin is unloaded, in order to prevent memory errors.<br />
<br />
==Do I need to #include every individual .inc?==<br />
No. <tt>#include <sourcemod></tt> will give you 95% of the .incs. Similarly, <tt>#include <sdktools></tt> includes everything starting with <sdktools>.<br />
<br />
==Why don't some events fire?==<br />
There is no guarantee that events will fire. The event listing is not a specification, it is a list of the events that a game is capable of firing. Whether the game actually fires them is up to Valve or the developer.<br />
<br />
==Do I need to CloseHandle timers?==<br />
No. In fact, doing so may cause errors. Timers naturally die on their own unless they are infinite timers, in which case you can use KillTimer() or die gracefully by returning <tt>Plugin_Stop</tt> in the callback.<br />
<br />
==Are clients disconnected on mapchange?==<br />
All clients are fully disconnected before the map changes. They are all reconnected after the next map starts.<br />
<br />
If you only want to detect when a client initially connects or leaves your server, hook the [[Generic Source Server Events#player_connect|player_connect]] or [[Generic Source Server Events#player_disconnect|player_disconnect]] events respectively.<br />
<br />
==Why am I getting "function prototypes do not match" errors?==<br />
When you see this error, you'll most likely find that the issue comes from any callback functions referenced in the line(s) that are causing the error.<br />
<br />
When you call a function that takes another function as a callback, the callback function must be declared with the correct number of parameter and return types.<br />
<br />
For example, [https://sm.alliedmods.net/new-api/console/RegConsoleCmd <tt>RegConsoleCommand</tt>] must be called with a callback that has with the exact arguments and return type as specified by the [https://sm.alliedmods.net/new-api/console/ConCmd <tt>ConCmd</tt>] definition.<br />
<br />
==When do I need to manually unhook things?==<br />
You only need to do so when you do not want the callback to fire anymore while the plugin is running. SourceMod itself, as well as extensions such as SDKHooks, unhooks entities and players when they are removed and disconnected, respectively. Everything a plugin hooks is unhooked when it is unloaded.<br />
<br />
=Further Reading=<br />
For further reading, see the "Scripting" section at the [http://docs.sourcemod.net/ SourceMod Documentation], as well as [https://wiki.alliedmods.net/Scripting_FAQ_(SourceMod) Yak's FAQs on Scripting].<br />
<br />
[[Category:SourceMod Scripting]]<br />
<br />
{{LanguageSwitch}}</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Admin_Commands_(SourceMod)&diff=10877Admin Commands (SourceMod)2019-11-04T04:57:41Z<p>Naleksuh: /* How to Target */ users can only be used by the server console, status is better because client consoles can also use</p>
<hr />
<div>{{Languages|Admin Commands (SourceMod)}}<br />
__FORCETOC__<br />
This page lists all of the major admin commands in SourceMod. <br />
<br />
'''Chat Triggers''': Remember that commands do not have to be entered through the console; they can be entered via chat triggers. For example, saying "!ban bail" in chat will execute the same command as "sm_ban" and forward the output to chat. You can also use "/" instead of "!" to suppress your command from being shown to users.<br />
<br />
=How to Target=<br />
<br />
'''General targets''':<br />
<ul><br />
<li>name - Exact name match, or partial name match (if the partial string is unique).</li><br />
<li>#userid - If userid is numeric, the player will be targeted by their userid (found via the "status" command).</li><br />
<li>#steamid - Matches by Steam ID. If you use colons (:), you must enclose in quotes. Otherwise, you can use an underscore (_) instead. Examples: <tt>"#STEAM_0:1:4433"</tt>, <tt>#STEAM_0_1_4433</tt></li><br />
<li>#&lt;name&gt; - Exact name match after the # sign.<br />
<li>@all - All players (available on most commands).</li><br />
<li>@bots - All bots (available on most commands).</li><br />
<li>@alive - All alive players (available on most commands that accept alive players).</li><br />
<li>@dead - All dead players (available on most commands that accept dead players).</li><br />
<li>@humans - All non-bot players (available on most commands).</li><br />
<li>@aim - Current player the admin is directly aiming at.</li><br />
<li>@me - Target self.</li><br />
<li>@!me - Target everyone but yourself.</li><br />
</ul><br />
<br />
Note that name matches occur last, "magic targets" (such as # and @) are processed first. This means that "@all" will target @all players, even if there is a player named "@all". You should target "#@all" instead.<br />
<br />
'''Counter-Strike only''':<br />
<ul><br />
<li>@ct or @cts - All Counter-Terrorists</li><br />
<li>@t or @ts - All Terrorists</li><br />
</ul><br />
<br />
'''Team Fortress 2 Only''':<br />
<ul><br />
<li>@red - All RED team members</li><br />
<li>@blue - All BLUE team members</li><br />
</ul><br />
<br />
=Basic Commands=<br />
These are basic commands found in plugins that have been deemed safe for [[War_Mode_(SourceMod)|War Mode]]; they provide simple functionality for administering your server.<br />
<br />
{| class="wikitable"<br />
! Command<br />
! Plugin<br />
! Access<br />
! Format<br />
! Description<br />
|-<br />
| sm_addban<br />
| basebans<br />
| rcon<br />
| <nowiki><time> <steamid> [reason]</nowiki><br />
| Adds a Steam ID to Source's ban list.<br />
|-<br />
| sm_admin<br />
| adminmenu<br />
| admin<br />
|<br />
| Displays the [[Admin_Menu_(SourceMod_Scripting)|admin menu]].<br />
|-<br />
| sm_ban<br />
| basebans<br />
| ban<br />
| <nowiki><#userid|name> <minutes|0> </nowiki>[reason]<br />
| Bans a client.<br />
|-<br />
| sm_banip<br />
| basebans<br />
| ban<br />
| <nowiki><ip|#userid|name> <time></nowiki> [reason]<br />
| Adds an IP address to Source's ban list. Only someone with <tt>rcon</tt> access can ban an arbitrary IP.<br />
|-<br />
| sm_cancelvote<br />
| basecommands<br />
| vote<br />
|<br />
| Cancels any vote in progress.<br />
|-<br />
| sm_cvar<br />
| basecommands<br />
| cvar<br />
| <nowiki><cvar> [value]</nowiki><br />
| Retrieves or changes a cvar value. Protected cvars can only be accessed with password access, and sv_cheats can only be accessed with cheat access. To add a cvar to the protected list (which by default contains all cvars flagged PROTECTED, rcon_password, sm_show_activity, and sm_immunity_mode), use sm_cvar protect <name>.<br />
|-<br />
| sm_execcfg<br />
| basecommands<br />
| config<br />
| <nowiki><filename></nowiki><br />
| Executes a config file (path not needed, but extension is).<br />
|-<br />
| sm_help<br />
| adminhelp<br />
| admin<br />
| <nowiki>[page|search]</nowiki><br />
| Lists all admin commands. Output is paginated and a page number can be specified. Alternately, a search term can be specified to search for a specific command.<br />
|-<br />
| sm_kick<br />
| basecommands<br />
| kick<br />
| <nowiki><#userid|name></nowiki> [reason]<br />
| Kicks a player.<br />
|-<br />
| sm_map<br />
| basecommands<br />
| map<br />
| <nowiki><map></nowiki><br />
| Changes the current map.<br />
|-<br />
| sm_rcon<br />
| basecommands<br />
| rcon<br />
| <nowiki><argstring></nowiki><br />
| Executes the argument string via rcon. You will only see RCON output on SourceMod 1.4 or above.<br />
|-<br />
| sm_reloadadmins<br />
| basecommands<br />
| config<br />
|<br />
| Refreshes the Admin cache from all sources.<br />
|-<br />
| sm_unban<br />
| basebans<br />
| unban<br />
| <nowiki><steamid|ip></nowiki><br />
| Unbans a Steam ID or an IP.<br />
|-<br />
| sm_who<br />
| basecommands<br />
| admin<br />
| <nowiki>[#userid|name]</nowiki><br />
| Lists all users and their access rights, or a specific user's access rights.<br />
|}<br />
<br />
=Extended Commands=<br />
These commands provide extended functionality that may not be present on all games, either due to game or engine differences. In general, they work on the most popular mods. If you have a mod which is new, or not supported yet due to lower popularity, file a [http://bugs.alliedmods.net/index.php?project=5&do=index feature request].<br />
<br />
{| class="wikitable"<br />
|-<br />
! Command<br />
! Plugin<br />
! Access<br />
! Format<br />
! Description<br />
|-<br />
| sm_beacon<br />
| funcommands<br />
| slay<br />
| <nowiki><target></nowiki><br />
| Adds a ring around each target, making them easily visible.<br />
|-<br />
| sm_burn<br />
| funcommands<br />
| slay<br />
| <nowiki><target> [time]</nowiki><br />
| Sets the target(s) on fire for the specified amount of time. This may or may not work fully on certain games (for example, TF2 is missing the fire sprite, but clients will bleed/lose health). If specified, burning effect will stop after the [time] seconds.<br />
|-<br />
| sm_chat<br />
| basechat<br />
| chat<br />
| <nowiki><message></nowiki><br />
| Sends a say-chat message to all admins.<br />
|-<br />
| sm_csay<br />
| basechat<br />
| chat<br />
| <nowiki><message></nowiki><br />
| Sends a centered message to all players.<br />
|-<br />
| sm_gag<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Prevents the target(s) from using messagemode/say chat.<br />
|-<br />
| sm_hsay<br />
| basechat<br />
| chat<br />
| <nowiki><message></nowiki><br />
| Sends a message to all players via a center-bottom hint box.<br />
|-<br />
| sm_msay<br />
| basechat<br />
| chat<br />
| <nowiki><message></nowiki><br />
| Sends a message as a menu panel (only meaningful on games that support radio menus).<br />
|-<br />
| sm_mute<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Prevents the target(s) from using voice chat.<br />
|-<br />
| sm_play<br />
| sounds<br />
| admin<br />
| <nowiki><target> <file></nowiki><br />
| Plays a sound file on the server to each target.<br />
|-<br />
| sm_psay<br />
| basechat<br />
| chat<br />
| <nowiki><target> <message></nowiki><br />
| Sends a private chat message to a single target.<br />
|-<br />
| sm_rename<br />
| playercommands<br />
| slay<br />
| <nowiki><#userid|name></nowiki><br />
| Changes the name of a player.<br />
|-<br />
| sm_resetcvar<br />
| basecommands<br />
| cvar<br />
| <nowiki><cvar></nowiki><br />
| Resets CVAR value back to default.<br />
|-<br />
| sm_say<br />
| basechat<br />
| chat<br />
| <nowiki><message></nowiki><br />
| Sends a say-chat message to all players.<br />
|-<br />
| sm_silence<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Performs both a gag and mute on the target(s).<br />
|-<br />
| sm_slap<br />
| playercommands<br />
| slay<br />
| <nowiki><target> [damage]</nowiki><br />
| "Slaps" a player, emitting a noise and throwing them in a random direction. If specified, the damage amount will be subtracted from each target's health.<br />
|-<br />
| sm_slay<br />
| playercommands<br />
| slay<br />
| <nowiki><target></nowiki><br />
| Kills a player.<br />
|-<br />
| sm_tsay<br />
| basechat<br />
| chat<br />
| <nowiki>[color] <message></nowiki><br />
| Sends a top-left message to all players. If no color is specified, the text will be white. Colors available are: white, red, green, blue, yellow, purple, cyan, orange, pink, olive, lime, violet, lightblue. The names are not case sensitive.<br />
|-<br />
| sm_ungag<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Allows the target(s) to use messagemode/say chat again.<br />
|-<br />
| sm_unmute<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Allows the target(s) to use voice chat again.<br />
|-<br />
| sm_unsilence<br />
| basecomm<br />
| chat<br />
| <nowiki><target></nowiki><br />
| Perfoms both an ungag and unmute on the target(s).<br />
|}<br />
<br />
=Vote Commands=<br />
These commands are listed separately as they are all related to voting. None of them are available in war mode by default.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Command<br />
! Plugin<br />
! Access<br />
! Format<br />
! Description<br />
|-<br />
| sm_vote<br />
| basevotes<br />
| vote<br />
| <nowiki><question> [answer1] [answer2] [answer3] ...</nowiki><br />
| Starts an arbitrary vote with the given arguments as answers. If no answer parameters are supplied, the answer options will be Yes and No localized into each client's language.<br />
|-<br />
| sm_votealltalk<br />
| funvotes<br />
| vote<br />
| <br />
| Starts a vote to change the value of sv_alltalk.<br />
|-<br />
| sm_voteban<br />
| basevotes<br />
| vote, ban<br />
| <nowiki><target> [reason]</nowiki><br />
| Starts a vote to ban a single player for thirty minutes.<br />
|-<br />
| sm_voteburn<br />
| funvotes<br />
| vote, slay<br />
| <nowiki><target></nowiki><br />
| Starts a vote to burn a single player.<br />
|-<br />
| sm_voteff<br />
| funvotes<br />
| vote<br />
| <br />
| Starts a vote to change the value of mp_friendlyfire.<br />
|-<br />
| sm_votegravity<br />
| funvotes<br />
| vote<br />
| <nowiki><amount> [amount2] [amount3] ...</nowiki><br />
| Initiates a vote to change the value of sv_gravity.<br />
|-<br />
| sm_votekick<br />
| basevotes<br />
| vote, kick<br />
| <nowiki><target> [reason]</nowiki><br />
| Starts a vote to kick a single player.<br />
|-<br />
| sm_votemap<br />
| basevotes<br />
| vote, map<br />
| <nowiki><map> [map2] [map3] ...</nowiki><br />
| Starts a vote to change the map.<br />
|-<br />
| sm_voteslay<br />
| funvotes<br />
| vote, slay<br />
| <nowiki><target></nowiki><br />
| Starts a vote to slay a single player.<br />
|}<br />
<br />
[[Category:SourceMod Documentation]]</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Team_Fortress_2_Events&diff=10876Team Fortress 2 Events2019-11-04T04:56:03Z<p>Naleksuh: actual name</p>
<hr />
<div>:''Refer back to [[Game Events (Source)]] for more events.''<br />
The following events can also be found in '''tf\tf2_misc_dir.vpk''' in the file '''resource\modevents.res'''.<br />
<br />
=== intro_finish ===<br />
{{begin-hl2msg|intro_finish|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== intro_nextcamera ===<br />
{{begin-hl2msg|intro_nextcamera|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== player_changeclass ===<br />
{{qnotice|When a player changes their class}}<br><br />
{{begin-hl2msg|player_changeclass|string}}<br />
{{hl2msg|short|userid|user ID who changed class}}<br />
{{hl2msg|short|class|class that they changed to}}<br />
{{end-hl2msg}}<br />
<br />
=== player_death ===<br />
{{qnotice|When a player dies}}<br><br />
{{qnotice|dominated, assister_dominated, revenge, assister_revenge, first_blood, and feign_death no longer exist in this event }}<br><br />
{{begin-hl2msg|player_death|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{hl2msg|short|stun_flags|victim's stun flags at the moment of death}}<br />
{{hl2msg|short|death_flags|death flags.}}<br />
{{hl2msg|bool|silent_kill|}}<br />
{{hl2msg|short|playerpenetratecount|}}<br />
{{hl2msg|string|assister_fallback|contains a string to use if "assister" is -1}}<br />
{{hl2msg|short|kill_streak_total|Kill streak count (level)}}<br />
{{hl2msg|short|kill_streak_wep|Kill streak for killing weapon}}<br />
{{hl2msg|short|kill_streak_assist|Kill streak for assister count}}<br />
{{hl2msg|short|kill_streak_victim|Victims kill streak}}<br />
{{hl2msg|short|ducks_streaked|Duck streak increment from this kill}}<br />
{{hl2msg|short|duck_streak_total|Duck streak count for attacker}}<br />
{{hl2msg|short|duck_streak_assist|Duck streak count for assister}}<br />
{{hl2msg|short|duck_streak_victim|(former) duck streak count for victim}}<br />
{{hl2msg|bool|rocket_jump|was the victim rocket jumping}}<br />
{{hl2msg|short|weapon_def_index|item def index of weapon killer used}}<br />
{{hl2msg|short|crit_type|Crit type of kill. (0: None, 1: Mini, 2: Full)}}<br />
{{end-hl2msg}}<br />
<br />
=== tf_map_time_remaining ===<br />
{{begin-hl2msg|tf_map_time_remaining|string}}<br />
{{hl2msg|long|seconds|}}<br />
{{end-hl2msg}}<br />
<br />
=== tf_game_over ===<br />
{{qnotice|When a tf game ends}}<br><br />
{{begin-hl2msg|tf_game_over|string}}<br />
{{hl2msg|string|reason|why the game is over (timelimit, winlimit)}}<br />
{{end-hl2msg}}<br />
<br />
=== ctf_flag_captured ===<br />
{{qnotice|When a flag is captured by a player}}<br><br />
{{begin-hl2msg|ctf_flag_captured|string}}<br />
{{hl2msg|short|capping_team|}}<br />
{{hl2msg|short|capping_team_score|}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_initialized ===<br />
{{qnotice|When a player begins to capture a control point}}<br><br />
{{begin-hl2msg|controlpoint_initialized|string}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_updateimages ===<br />
{{begin-hl2msg|controlpoint_updateimages|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_updatelayout ===<br />
{{begin-hl2msg|controlpoint_updatelayout|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_updatecapping ===<br />
{{begin-hl2msg|controlpoint_updatecapping|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_updateowner ===<br />
{{begin-hl2msg|controlpoint_updateowner|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_starttouch ===<br />
{{qnotice|When a player enters a capture point zone}}<br><br />
{{begin-hl2msg|controlpoint_starttouch|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|short|area|index of the control point area}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_endtouch ===<br />
{{qnotice|When a player leaves a capture point zone}}<br><br />
{{begin-hl2msg|controlpoint_endtouch|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|short|area|index of the control point area}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_pulse_element ===<br />
{{begin-hl2msg|controlpoint_pulse_element|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_fake_capture ===<br />
{{begin-hl2msg|controlpoint_fake_capture|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|short|int_data|}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_fake_capture_mult ===<br />
{{begin-hl2msg|controlpoint_fake_capture_mult|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|short|int_data|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_selected ===<br />
{{qnotice|When a round is selected.}}<br><br />
{{begin-hl2msg|teamplay_round_selected|string}}<br />
{{hl2msg|string|round|name of the round selected}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_start ===<br />
{{qnotice|round restart}}<br> <br />
{{begin-hl2msg|teamplay_round_start|string}}<br />
{{hl2msg|bool|full_reset|is this a full reset of the map}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_active ===<br />
{{qnotice|called when round is active, players can move}}<br> <br />
{{begin-hl2msg|teamplay_round_active|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_waiting_begins ===<br />
{{qnotice|When the "waiting for players" pre-round begins}}<br><br />
{{begin-hl2msg|teamplay_waiting_begins|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_waiting_ends ===<br />
{{qnotice|When the "waiting for players" pre-round ends}}<br><br />
{{begin-hl2msg|teamplay_waiting_ends|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_waiting_abouttoend ===<br />
{{qnotice|When the "waiting for players" pre-round is about to end}}<br><br />
{{begin-hl2msg|teamplay_waiting_abouttoend|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_restart_round ===<br />
{{qnotice|When a round is restarted}}<br><br />
{{begin-hl2msg|teamplay_restart_round|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_ready_restart ===<br />
{{begin-hl2msg|teamplay_ready_restart|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_restart_seconds ===<br />
{{begin-hl2msg|teamplay_round_restart_seconds|string}}<br />
{{hl2msg|short|seconds|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_team_ready ===<br />
{{begin-hl2msg|teamplay_team_ready|string}}<br />
{{hl2msg|byte|team|which team is ready}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_win ===<br />
{{qnotice|When a team wins a round}}<br><br />
{{begin-hl2msg|teamplay_round_win|string}}<br />
{{hl2msg|byte|team|which team won the round}}<br />
{{hl2msg|byte|winreason|the reason the team won}}<br />
{{hl2msg|short|flagcaplimit|if win reason was flag cap limit, the value of the flag cap limit}}<br />
{{hl2msg|short|full_round|was this a full round or a mini-round}}<br />
{{hl2msg|float|round_time|elapsed time of this round}}<br />
{{hl2msg|short|losing_team_num_caps|# of caps this round by losing team}}<br />
{{hl2msg|byte|was_sudden_death|did a team win this after entering sudden death}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_update_timer ===<br />
{{begin-hl2msg|teamplay_update_timer|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_round_stalemate ===<br />
{{qnotice|When a game ends in a stalemate}}<br><br />
{{begin-hl2msg|teamplay_round_stalemate|string}}<br />
{{hl2msg|byte|reason|why the stalemate is occuring}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_overtime_begin ===<br />
{{qnotice|When an overtime round begins}}<br><br />
{{begin-hl2msg|teamplay_overtime_begin|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_overtime_end ===<br />
{{qnotice|When an overtime round ends}}<br><br />
{{begin-hl2msg|teamplay_overtime_end|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_suddendeath_begin ===<br />
{{qnotice|When a sudden death round begins}}<br><br />
{{begin-hl2msg|teamplay_suddendeath_begin|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_suddendeath_end ===<br />
{{qnotice|When a sudden death round ends}}<br><br />
{{begin-hl2msg|teamplay_suddendeath_end|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_game_over ===<br />
{{qnotice|When a teamplay game ends}}<br><br />
{{begin-hl2msg|teamplay_game_over|string}}<br />
{{hl2msg|string|reason|why the game is over (timelimit, winlimit)}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_map_time_remaining ===<br />
{{begin-hl2msg|teamplay_map_time_remaining|string}}<br />
{{hl2msg|short|seconds|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_broadcast_audio ===<br />
{{qnotice|Broadcast an audio file by game_sound name. Audio files are documented in the game_sound files inside tf2_misc_dir.vpk.}}<br><br />
{{begin-hl2msg|teamplay_broadcast_audio|string}}<br />
{{hl2msg|byte|team|which team should hear the broadcast. -1 will make everyone hear it.}}<br />
{{hl2msg|string|sound|sound to play}}<br />
{{hl2msg|short|additional_flags|additional sound flags to pass through to sound system}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_timer_flash ===<br />
{{begin-hl2msg|teamplay_timer_flash|string}}<br />
{{hl2msg|short|time_remaining|how many seconds until the round ends}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_timer_time_added ===<br />
{{begin-hl2msg|teamplay_timer_time_added|string}}<br />
{{hl2msg|short|timer|entindex of the timer}}<br />
{{hl2msg|short|seconds_added|how many seconds were added to the round timer}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_point_startcapture ===<br />
{{qnotice|When a point is beginning to be captured}}<br><br />
{{begin-hl2msg|teamplay_point_startcapture|string}}<br />
{{hl2msg|byte|cp|index of the point being captured}}<br />
{{hl2msg|string|cpname|name of the point}}<br />
{{hl2msg|byte|team|which team currently owns the point}}<br />
{{hl2msg|byte|capteam|which team is capping}}<br />
{{hl2msg|string|cappers|string where each character is a player index of someone capping}}<br />
{{hl2msg|float|captime|time between when this cap started and when the point last changed hands}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_point_captured ===<br />
{{qnotice|When a control point is captured by a team}}<br><br />
{{begin-hl2msg|teamplay_point_captured|string}}<br />
{{hl2msg|byte|cp|index of the point that was captured}}<br />
{{hl2msg|string|cpname|name of the point}}<br />
{{hl2msg|byte|team|which team capped}}<br />
{{hl2msg|string|cappers|string where each character is a player index of someone that capped}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_point_locked ===<br />
{{begin-hl2msg|teamplay_point_locked|string}}<br />
{{hl2msg|byte|cp|index of the point being captured}}<br />
{{hl2msg|string|cpname|name of the point}}<br />
{{hl2msg|byte|team|which team currently owns the point}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_point_unlocked ===<br />
{{begin-hl2msg|teamplay_point_unlocked|string}}<br />
{{hl2msg|byte|cp|index of the point being captured}}<br />
{{hl2msg|string|cpname|name of the point}}<br />
{{hl2msg|byte|team|which team currently owns the point}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_capture_broken ===<br />
{{begin-hl2msg|teamplay_capture_broken|string}}<br />
{{hl2msg|byte|cp|}}<br />
{{hl2msg|string|cpname|}}<br />
{{hl2msg|float|time_remaining|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_capture_blocked ===<br />
{{qnotice|When a player blocks the capture of a control point}}<br><br />
{{begin-hl2msg|teamplay_capture_blocked|string}}<br />
{{hl2msg|byte|cp|index of the point that was blocked}}<br />
{{hl2msg|string|cpname|name of the point}}<br />
{{hl2msg|byte|blocker|index of the player that blocked the cap}}<br />
{{hl2msg|byte|victim|index of the player that died, causing the block}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_flag_event ===<br />
{{begin-hl2msg|teamplay_flag_event|string}}<br />
{{hl2msg|short|player|player this event involves}}<br />
{{hl2msg|short|carrier|the carrier if needed}}<br />
{{hl2msg|short|eventtype|pick up, capture, defend, dropped}}<br />
{{hl2msg|byte|home|whether or not the flag was home (only set for TF_FLAGEVENT_PICKEDUP)}}<br />
{{hl2msg|byte|team|which team the flag belongs to}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_win_panel ===<br />
{{qnotice|When the win-game panel is displayed}}<br><br />
{{begin-hl2msg|teamplay_win_panel|string}}<br />
{{hl2msg|byte|panel_style|for client to determine layout}}<br />
{{hl2msg|byte|winning_team|}}<br />
{{hl2msg|byte|winreason|the reason the team won}}<br />
{{hl2msg|string|cappers|string where each character is a player index of someone that capped}}<br />
{{hl2msg|short|flagcaplimit|if win reason was flag cap limit, the value of the flag cap limit}}<br />
{{hl2msg|short|blue_score|red team score}}<br />
{{hl2msg|short|red_score|blue team score}}<br />
{{hl2msg|short|blue_score_prev|previous red team score}}<br />
{{hl2msg|short|red_score_prev|previous blue team score}}<br />
{{hl2msg|short|round_complete|is this a complete round, or the end of a mini-round}}<br />
{{hl2msg|short|rounds_remaining|# of rounds remaining for wining team, if mini-round}}<br />
{{hl2msg|short|player_1|}}<br />
{{hl2msg|short|player_1_points|}}<br />
{{hl2msg|short|player_2|}}<br />
{{hl2msg|short|player_2_points|}}<br />
{{hl2msg|short|player_3|}}<br />
{{hl2msg|short|player_3_points|}}<br />
{{hl2msg|short|killstreak_player_1|}}<br />
{{hl2msg|short|killstreak_player_1_count|}}<br />
{{hl2msg|byte|game_over|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_teambalanced_player ===<br />
{{qnotice|When a player is balanced to another team}}<br><br />
{{begin-hl2msg|teamplay_teambalanced_player|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|byte|team|which team the player is being moved to}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_setup_finished ===<br />
{{qnotice|When the setup round ends}}<br><br />
{{begin-hl2msg|teamplay_setup_finished|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_alert ===<br />
{{qnotice|When an alert is shown to a player}}<br><br />
{{begin-hl2msg|teamplay_alert|string}}<br />
{{hl2msg|short|alert_type|which alert type is this (scramble, etc)?}}<br />
{{end-hl2msg}}<br />
<br />
=== training_complete ===<br />
{{begin-hl2msg|training_complete|string}}<br />
{{hl2msg|string|next_map|next map (if any)}}<br />
{{hl2msg|string|map|the name of the map this screen is on.}}<br />
{{hl2msg|string|text|text to show}}<br />
{{end-hl2msg}}<br />
<br />
=== show_freezepanel ===<br />
{{qnotice|When the death-snapshot panel is shown}}<br><br />
{{begin-hl2msg|show_freezepanel|string}}<br />
{{hl2msg|short|killer|entindex of the killer entity}}<br />
{{end-hl2msg}}<br />
<br />
=== hide_freezepanel ===<br />
{{qnotice|When the death-snapshot panel is hidden}}<br><br />
{{begin-hl2msg|hide_freezepanel|string}}<br />
{{end-hl2msg}}<br />
<br />
=== freezecam_started ===<br />
{{qnotice|When a player enters the death-snapshot view}}<br><br />
{{begin-hl2msg|freezecam_started|string}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_changeteam ===<br />
{{qnotice|When a LAN player changes team}}<br><br />
{{begin-hl2msg|localplayer_changeteam|string}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_score_changed ===<br />
{{begin-hl2msg|localplayer_score_changed|string}}<br />
{{hl2msg|short|score|}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_changeclass ===<br />
{{qnotice|When a LAN player changes class}}<br><br />
{{begin-hl2msg|localplayer_changeclass|string}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_respawn ===<br />
{{qnotice|When a LAN player respawns}}<br><br />
{{begin-hl2msg|localplayer_respawn|string}}<br />
{{end-hl2msg}}<br />
<br />
=== building_info_changed ===<br />
{{begin-hl2msg|building_info_changed|string}}<br />
{{hl2msg|byte|building_type|}}<br />
{{hl2msg|byte|object_mode|}}<br />
{{hl2msg|byte|remove|}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_changedisguise ===<br />
{{qnotice|When a LAN player changes their disguise as a spy}}<br><br />
{{begin-hl2msg|localplayer_changedisguise|string}}<br />
{{hl2msg|bool|disguised|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_account_changed ===<br />
{{begin-hl2msg|player_account_changed|string}}<br />
{{hl2msg|short|old_value|}}<br />
{{hl2msg|short|new_value|}}<br />
{{end-hl2msg}}<br />
<br />
=== spy_pda_reset ===<br />
{{begin-hl2msg|spy_pda_reset|string}}<br />
{{end-hl2msg}}<br />
<br />
=== flagstatus_update ===<br />
{{begin-hl2msg|flagstatus_update|string}}<br />
{{hl2msg|short|userid|user ID of the player who now has the flag}}<br />
{{hl2msg|long|entindex|ent index of flag}}<br />
{{end-hl2msg}}<br />
<br />
=== player_stats_updated ===<br />
{{qnotice|When a players stats are updated}}<br><br />
{{begin-hl2msg|player_stats_updated|string}}<br />
{{hl2msg|bool|forceupload|}}<br />
{{end-hl2msg}}<br />
<br />
=== playing_commentary ===<br />
{{qnotice|When a commentary is being played}}<br><br />
{{begin-hl2msg|playing_commentary|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_chargedeployed ===<br />
{{qnotice|When an uber is deployed}}<br><br />
{{begin-hl2msg|player_chargedeployed|string}}<br />
{{hl2msg|short|userid|user ID of medic who deployed charge}}<br />
{{hl2msg|short|targetid|user ID of who the medic charged}}<br />
{{end-hl2msg}}<br />
<br />
=== player_builtobject ===<br />
{{qnotice|When a player builds an object}}<br><br />
{{begin-hl2msg|player_builtobject|string}}<br />
{{hl2msg|short|userid|user ID of the builder}}<br />
{{hl2msg|byte|object|type of object built}}<br />
{{hl2msg|short|index|index of the object}}<br />
{{end-hl2msg}}<br />
<br />
=== player_upgradedobject ===<br />
{{begin-hl2msg|player_upgradedobject|string}}<br />
{{hl2msg|short|userid|user ID of the upgrader}}<br />
{{hl2msg|byte|object|type of object upgraded}}<br />
{{hl2msg|short|index|index of the object}}<br />
{{hl2msg|bool|isbuilder|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_carryobject ===<br />
{{begin-hl2msg|player_carryobject|string}}<br />
{{hl2msg|short|userid|user ID of the builder}}<br />
{{hl2msg|byte|object|type of object carried}}<br />
{{hl2msg|short|index|index of the object}}<br />
{{end-hl2msg}}<br />
<br />
=== player_dropobject ===<br />
{{begin-hl2msg|player_dropobject|string}}<br />
{{hl2msg|short|userid|user ID of the builder}}<br />
{{hl2msg|byte|object|type of object dropped}}<br />
{{hl2msg|short|index|index of the object}}<br />
{{end-hl2msg}}<br />
<br />
=== object_removed ===<br />
{{begin-hl2msg|object_removed|string}}<br />
{{hl2msg|short|userid|user ID of the object owner}}<br />
{{hl2msg|short|objecttype|type of object removed}}<br />
{{hl2msg|short|index|index of the object removed}}<br />
{{end-hl2msg}}<br />
<br />
=== object_destroyed ===<br />
{{qnotice|When a player destroys an object}}<br><br />
{{begin-hl2msg|object_destroyed|string}}<br />
{{hl2msg|short|userid|user ID of the object owner}}<br />
{{hl2msg|short|attacker|user ID who destroyed the object}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|id of the weapon used}}<br />
{{hl2msg|short|objecttype|type of object destroyed}}<br />
{{hl2msg|short|index|index of the object destroyed}}<br />
{{hl2msg|bool|was_building|object was being built when it died}}<br />
{{end-hl2msg}}<br />
<br />
=== object_detonated ===<br />
{{begin-hl2msg|object_detonated|string}}<br />
{{hl2msg|short|userid|user ID of the object owner}}<br />
{{hl2msg|short|objecttype|type of object removed}}<br />
{{hl2msg|short|index|index of the object removed}}<br />
{{end-hl2msg}}<br />
<br />
=== achievement_earned ===<br />
{{qnotice|When a player earns an achievement}}<br><br />
{{begin-hl2msg|achievement_earned|string}}<br />
{{hl2msg|byte|player|entindex of the player}}<br />
{{hl2msg|short|achievement|achievement ID}}<br />
{{end-hl2msg}}<br />
<br />
=== spec_target_updated ===<br />
{{begin-hl2msg|spec_target_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== tournament_stateupdate ===<br />
{{begin-hl2msg|tournament_stateupdate|string}}<br />
{{hl2msg|short|userid|user ID on server}}<br />
{{hl2msg|bool|namechange|}}<br />
{{hl2msg|short|readystate|}}<br />
{{hl2msg|string|newname|players new name}}<br />
{{end-hl2msg}}<br />
<br />
=== tournament_enablecountdown ===<br />
{{begin-hl2msg|tournament_enablecountdown|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_calledformedic ===<br />
{{qnotice|When a player calls for a medic. This does not appear to fire for the server.}}<br><br />
{{begin-hl2msg|player_calledformedic|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_askedforball ===<br />
{{qnotice|When a player asks for the ball in PASStime.}}<br><br />
{{begin-hl2msg|player_askedforball|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_becameobserver ===<br />
{{begin-hl2msg|localplayer_becameobserver|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_ignited_inv ===<br />
{{qnotice|sent when a player is ignited by a pyro who is being invulned, only to the medic who's doing the invulning}}<br> <br />
{{begin-hl2msg|player_ignited_inv|string}}<br />
{{hl2msg|byte|pyro_entindex|entindex of the pyro who ignited the victim}}<br />
{{hl2msg|byte|victim_entindex|entindex of the player ignited by the pyro}}<br />
{{hl2msg|byte|medic_entindex|entindex of the medic releasing the invuln}}<br />
{{end-hl2msg}}<br />
<br />
=== player_ignited ===<br />
{{qnotice|sent when a player is ignited, only to the two players involved}}<br> <br />
{{begin-hl2msg|player_ignited|string}}<br />
{{hl2msg|byte|pyro_entindex|entindex of the pyro who ignited the victim}}<br />
{{hl2msg|byte|victim_entindex|entindex of the player ignited by the pyro}}<br />
{{hl2msg|byte|weaponid|weaponid of the weapon used}}<br />
{{end-hl2msg}}<br />
<br />
=== player_extinguished ===<br />
{{qnotice|sent when a burning player is extinguished by a medic}}<br> <br />
{{begin-hl2msg|player_extinguished|string}}<br />
{{hl2msg|byte|victim|entindex of the player that was extinguished}}<br />
{{hl2msg|byte|healer|entindex of the player who did the extinguishing}}<br />
{{hl2msg|short|itemdefindex|item defindex that did the extinguishing}}<br />
{{end-hl2msg}}<br />
<br />
=== player_teleported ===<br />
{{qnotice|Sent when a player is teleported}}<br><br />
{{begin-hl2msg|player_teleported|string}}<br />
{{hl2msg|short|userid|userid of the player}}<br />
{{hl2msg|short|builderid|userid of the player who built the teleporter}}<br />
{{hl2msg|float|dist|distance the player was teleported}}<br />
{{end-hl2msg}}<br />
<br />
=== player_healedmediccall ===<br />
{{qnotice|local player heals someone who called for medic.}}<br> <br />
{{begin-hl2msg|player_healedmediccall|string}}<br />
{{hl2msg|short|userid|userid of person who got healed}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_chargeready ===<br />
{{qnotice|local player has full medic charge}}<br> <br />
{{begin-hl2msg|localplayer_chargeready|string}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_winddown ===<br />
{{qnotice|local player minigun winddown}}<br> <br />
{{begin-hl2msg|localplayer_winddown|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_invulned ===<br />
{{qnotice|Send when a player is made invulnerable}}<br><br />
{{begin-hl2msg|player_invulned|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|short|medic_userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== escort_speed ===<br />
{{begin-hl2msg|escort_speed|string}}<br />
{{hl2msg|byte|team|which team}}<br />
{{hl2msg|byte|speed|}}<br />
{{hl2msg|byte|players|}}<br />
{{end-hl2msg}}<br />
<br />
=== escort_progress ===<br />
{{begin-hl2msg|escort_progress|string}}<br />
{{hl2msg|byte|team|which team}}<br />
{{hl2msg|float|progress|}}<br />
{{hl2msg|bool|reset|}}<br />
{{end-hl2msg}}<br />
<br />
=== escort_recede ===<br />
{{begin-hl2msg|escort_recede|string}}<br />
{{hl2msg|byte|team|which team}}<br />
{{hl2msg|float|recedetime|}}<br />
{{end-hl2msg}}<br />
<br />
=== gameui_activated ===<br />
{{begin-hl2msg|gameui_activated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== gameui_hidden ===<br />
{{begin-hl2msg|gameui_hidden|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_escort_score ===<br />
{{begin-hl2msg|player_escort_score|string}}<br />
{{hl2msg|byte|player|}}<br />
{{hl2msg|byte|points|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_healonhit ===<br />
{{begin-hl2msg|player_healonhit|string}}<br />
{{hl2msg|short|amount|}}<br />
{{hl2msg|byte|entindex|}}<br />
{{hl2msh|long|weapon_def_index|item def index of the healing weapon}}<br />
{{end-hl2msg}}<br />
<br />
=== player_stealsandvich ===<br />
{{begin-hl2msg|player_stealsandvich|string}}<br />
{{hl2msg|short|owner|}}<br />
{{hl2msg|short|target|}}<br />
{{end-hl2msg}}<br />
<br />
=== show_class_layout ===<br />
{{begin-hl2msg|show_class_layout|string}}<br />
{{hl2msg|bool|show|}}<br />
{{end-hl2msg}}<br />
<br />
=== show_vs_panel ===<br />
{{begin-hl2msg|show_vs_panel|string}}<br />
{{hl2msg|bool|show|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_damaged ===<br />
{{begin-hl2msg|player_damaged|string}}<br />
{{hl2msg|short|amount|}}<br />
{{hl2msg|long|type|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_hurt ===<br />
{{qnotice|When a player is hurt}}<br><br />
{{begin-hl2msg|player_hurt|string}}<br />
{{hl2msg|short|userid|victim}}<br />
{{hl2msg|short|health|victim health}}<br />
{{hl2msg|short|attacker|attacker}}<br />
{{hl2msg|short|damageamount|damage amount of victim take damage|}}<br />
{{hl2msg|short|custom|}}<br />
{{hl2msg|bool|showdisguisedcrit|if our attribute specifically crits disguised enemies we need to show it on the client}}<br />
{{hl2msg|bool|crit|if has crit on fire or hurt with crit}}<br />
{{hl2msg|bool|minicrit|if has minicrit on fire or hurt with minicrit}}<br />
{{hl2msg|bool|allseecrit|}}<br />
{{hl2msg|short|weaponid| weapon id of attacker}}<br />
{{hl2msg|byte|bonuseffect|}}<br />
{{end-hl2msg}}<br />
<br />
=== arena_player_notification ===<br />
{{begin-hl2msg|arena_player_notification|string}}<br />
{{hl2msg|byte|player|}}<br />
{{hl2msg|byte|message|}}<br />
{{end-hl2msg}}<br />
<br />
=== arena_match_maxstreak ===<br />
{{begin-hl2msg|arena_match_maxstreak|string}}<br />
{{hl2msg|byte|team|}}<br />
{{hl2msg|byte|streak|}}<br />
{{end-hl2msg}}<br />
<br />
=== arena_round_start ===<br />
{{qnotice|called when round is active, players can move}}<br> <br />
{{begin-hl2msg|arena_round_start|string}}<br />
{{end-hl2msg}}<br />
<br />
=== arena_win_panel ===<br />
{{begin-hl2msg|arena_win_panel|string}}<br />
{{hl2msg|byte|panel_style|for client to determine layout}}<br />
{{hl2msg|byte|winning_team|}}<br />
{{hl2msg|byte|winreason|the reason the team won - 1 (someone capped) 2 (entire team was killed)}}<br />
{{hl2msg|string|cappers|string where each character is a player index of someone that capped}}<br />
{{hl2msg|short|flagcaplimit|if win reason was flag cap limit, the value of the flag cap limit}}<br />
{{hl2msg|short|blue_score|red team score}}<br />
{{hl2msg|short|red_score|blue team score}}<br />
{{hl2msg|short|blue_score_prev|previous red team score}}<br />
{{hl2msg|short|red_score_prev|previous blue team score}}<br />
{{hl2msg|short|round_complete|is this a complete round, or the end of a mini-round}}<br />
{{hl2msg|short|player_1|}}<br />
{{hl2msg|short|player_1_damage|}}<br />
{{hl2msg|short|player_1_healing|}}<br />
{{hl2msg|short|player_1_lifetime|}}<br />
{{hl2msg|short|player_1_kills|}}<br />
{{hl2msg|short|player_2|}}<br />
{{hl2msg|short|player_2_damage|}}<br />
{{hl2msg|short|player_2_healing|}}<br />
{{hl2msg|short|player_2_lifetime|}}<br />
{{hl2msg|short|player_2_kills|}}<br />
{{hl2msg|short|player_3|}}<br />
{{hl2msg|short|player_3_damage|}}<br />
{{hl2msg|short|player_3_healing|}}<br />
{{hl2msg|short|player_3_lifetime|}}<br />
{{hl2msg|short|player_3_kills|}}<br />
{{hl2msg|short|player_4|}}<br />
{{hl2msg|short|player_4_damage|}}<br />
{{hl2msg|short|player_4_healing|}}<br />
{{hl2msg|short|player_4_lifetime|}}<br />
{{hl2msg|short|player_4_kills|}}<br />
{{hl2msg|short|player_5|}}<br />
{{hl2msg|short|player_5_damage|}}<br />
{{hl2msg|short|player_5_healing|}}<br />
{{hl2msg|short|player_5_lifetime|}}<br />
{{hl2msg|short|player_5_kills|}}<br />
{{hl2msg|short|player_6|}}<br />
{{hl2msg|short|player_6_damage|}}<br />
{{hl2msg|short|player_6_healing|}}<br />
{{hl2msg|short|player_6_lifetime|}}<br />
{{hl2msg|short|player_6_kills|}}<br />
{{end-hl2msg}}<br />
<br />
=== pve_win_panel ===<br />
{{qnotice|MvM Win Panel}}<br><br />
<br />
{{begin-hl2msg|pve_win_panel|string}}<br />
{{hl2msg|byte|panel_style|for client to determine layout}}<br />
{{hl2msg|byte|winning_team|}}<br />
{{hl2msg|byte|winreason|the reason the team won}}<br />
{{end-hl2msg}}<br />
<br />
=== air_dash ===<br />
{{qnotice|Called when a scout Performs Double Jump}}<br><br />
{{begin-hl2msg|air_dash|string}}<br />
{{hl2msg|byte|player|}}<br />
{{end-hl2msg}}<br />
<br />
=== landed ===<br />
{{begin-hl2msg|landed|string}}<br />
{{hl2msg|byte|player|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_damage_dodged ===<br />
{{qnotice|When a Player Evades Damage with Bonk}}<br><br />
{{begin-hl2msg|player_damage_dodged|string}}<br />
{{hl2msg|short|damage|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_stunned ===<br />
{{qnotice|When a Player is Stunned}}<br><br />
{{begin-hl2msg|player_stunned|string}}<br />
{{hl2msg|short|stunner|}}<br />
{{hl2msg|short|victim|}}<br />
{{hl2msg|bool|victim_capping|}}<br />
{{hl2msg|bool|big_stun|}}<br />
{{end-hl2msg}}<br />
<br />
=== scout_grand_slam ===<br />
{{qnotice|When a Player is Killed by the Scout Taunt}}<br><br />
{{begin-hl2msg|scout_grand_slam|string}}<br />
{{hl2msg|short|scout_id|}}<br />
{{hl2msg|short|target_id|}}<br />
{{end-hl2msg}}<br />
<br />
=== scout_slamdoll_landed ===<br />
{{begin-hl2msg|scout_slamdoll_landed|string}}<br />
{{hl2msg|short|target_index|}}<br />
{{hl2msg|float|x|}}<br />
{{hl2msg|float|y|}}<br />
{{hl2msg|float|z|}}<br />
{{end-hl2msg}}<br />
<br />
=== arrow_impact ===<br />
{{qnotice|When a player is hit by a Sniper's Huntsman arrow or Medic's Crusader's Crossbow arrow}}<br><br />
{{begin-hl2msg|arrow_impact|string}}<br />
{{hl2msg|short|attachedEntity|}}<br />
{{hl2msg|short|shooter|}}<br />
{{hl2msg|short|boneIndexAttached|}}<br />
{{hl2msg|float|bonePositionX|}}<br />
{{hl2msg|float|bonePositionY|}}<br />
{{hl2msg|float|bonePositionZ|}}<br />
{{hl2msg|float|boneAnglesX|}}<br />
{{hl2msg|float|boneAnglesY|}}<br />
{{hl2msg|float|boneAnglesZ|}}<br />
{{hl2msg|short|projectileType|}}<br />
{{hl2msg|bool|isCrit|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_jarated ===<br />
{{qnotice|sent when a player is jarated, only to the two players involved}}<br> <br />
{{begin-hl2msg|player_jarated|string}}<br />
{{hl2msg|byte|thrower_entindex|entindex of the player who threw the jarate}}<br />
{{hl2msg|byte|victim_entindex|entindex of the player receiving it}}<br />
{{end-hl2msg}}<br />
<br />
=== player_jarated_fade ===<br />
{{qnotice|sent when a player is jarated, only to the two players involved}}<br> <br />
<br />
{{begin-hl2msg|player_jarated_fade|string}}<br />
{{hl2msg|byte|thrower_entindex|entindex of the player who threw the jarate}}<br />
{{hl2msg|byte|victim_entindex|entindex of the player receiving it}}<br />
{{end-hl2msg}}<br />
<br />
=== player_shield_blocked ===<br />
{{qnotice|Sent when a Razorback blocks a backstab}}<br> <br />
<br />
{{begin-hl2msg|player_shield_blocked|string}}<br />
{{hl2msg|byte|attacker_entindex|entindex of the player who attacked}}<br />
{{hl2msg|byte|blocker_entindex|entindex of the player whose shield blocked the stab}}<br />
{{end-hl2msg}}<br />
<br />
=== player_pinned ===<br />
{{qnotice|When a player is pinned to a wall}}<br><br />
{{begin-hl2msg|player_pinned|string}}<br />
{{hl2msg|byte|pinned|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_healedbymedic ===<br />
{{begin-hl2msg|player_healedbymedic|string}}<br />
{{hl2msg|byte|medic|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_spawn ===<br />
{{begin-hl2msg|player_spawn|string}}<br />
{{hl2msg|short|userid|user ID who spawned}}<br />
{{hl2msg|short|team|team they spawned on}}<br />
{{hl2msg|short|class|class they spawned as}}<br />
{{end-hl2msg}}<br />
<br />
=== player_sapped_object ===<br />
{{begin-hl2msg|player_sapped_object|string}}<br />
{{hl2msg|short|userid|user ID of the spy}}<br />
{{hl2msg|short|ownerid|user ID of the building owner}}<br />
{{hl2msg|byte|object|}}<br />
{{hl2msg|short|sapperid|index of the sapper}}<br />
{{end-hl2msg}}<br />
<br />
=== item_found ===<br />
{{qnotice|When a player finds an item}}<br><br />
{{begin-hl2msg|item_found|string}}<br />
{{hl2msg|byte|player|entindex of the player}}<br />
{{hl2msg|byte|quality|quality of the item}}<br />
{{hl2msg|byte|method|method by which we acquired the item (TODO: Show which numbers represent which method of finding.)}}<br />
{{hl2msg|long|itemdef|the item definition index}}<br />
{{hl2msg|byte|isstrange|}}<br />
{{hl2msg|long|isunusual|}}<br />
{{hl2msg|float|wear|}}<br />
{{end-hl2msg}}<br />
<br />
=== show_annotation ===<br />
{{begin-hl2msg|show_annotation|string}}<br />
{{hl2msg|float|worldPosX|}}<br />
{{hl2msg|float|worldPosY|}}<br />
{{hl2msg|float|worldPosZ|}}<br />
{{hl2msg|float|worldNormalX|}}<br />
{{hl2msg|float|worldNormalY|}}<br />
{{hl2msg|float|worldNormalZ|}}<br />
{{hl2msg|long|id|}}<br />
{{hl2msg|string|text|name (unlocalized)}}<br />
{{hl2msg|float|lifetime|}}<br />
{{hl2msg|long|visibilityBitfield|bitfield of the players that can see this}}<br />
{{hl2msg|long|follow_entindex|if this is set, follow this entity}}<br />
{{hl2msg|bool|show_distance|}}<br />
{{hl2msg|string|play_sound|}}<br />
{{hl2msg|bool|show_effect|}}<br />
{{end-hl2msg}}<br />
<br />
=== hide_annotation ===<br />
{{begin-hl2msg|hide_annotation|string}}<br />
{{hl2msg|long|id|}}<br />
{{end-hl2msg}}<br />
<br />
=== post_inventory_application ===<br />
{{qnotice|sent when a player gets a whole new set of items, aka touches a resupply locker / respawn cabinet or spawns in.}}<br> <br />
{{begin-hl2msg|post_inventory_application|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_unlock_updated ===<br />
{{begin-hl2msg|controlpoint_unlock_updated|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{hl2msg|float|time|time}}<br />
{{end-hl2msg}}<br />
<br />
=== deploy_buff_banner ===<br />
{{begin-hl2msg|deploy_buff_banner|string}}<br />
{{hl2msg|byte|buff_type|type of buff (skin index)}}<br />
{{hl2msg|short|buff_owner|user ID of the person who gets the banner}}<br />
{{end-hl2msg}}<br />
<br />
=== player_buff ===<br />
{{begin-hl2msg|player_buff|string}}<br />
{{hl2msg|short|userid|user ID of the player the buff is being applied to}}<br />
{{hl2msg|short|buff_owner|user ID of the player with the banner}}<br />
{{hl2msg|byte|buff_type|type of buff}}<br />
{{end-hl2msg}}<br />
<br />
=== medic_death ===<br />
{{qnotice|When a medic dies}}<br><br />
{{begin-hl2msg|medic_death|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|short|healing|amount healed in this life}}<br />
{{hl2msg|bool|charged|had a full ubercharge?}}<br />
{{end-hl2msg}}<br />
<br />
=== overtime_nag ===<br />
{{begin-hl2msg|overtime_nag|string}}<br />
{{end-hl2msg}}<br />
<br />
=== teams_changed ===<br />
{{begin-hl2msg|teams_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== halloween_pumpkin_grab ===<br />
{{begin-hl2msg|halloween_pumpkin_grab|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== rocket_jump ===<br />
{{begin-hl2msg|rocket_jump|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|bool|playsound|}}<br />
{{end-hl2msg}}<br />
<br />
=== rocket_jump_landed ===<br />
{{begin-hl2msg|rocket_jump_landed|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== sticky_jump ===<br />
{{begin-hl2msg|sticky_jump|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|bool|playsound|}}<br />
{{end-hl2msg}}<br />
<br />
=== sticky_jump_landed ===<br />
{{begin-hl2msg|sticky_jump_landed|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== rocketpack_launch ===<br />
{{begin-hl2msg|rocketpack_launch|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|bool|playsound|}}<br />
{{end-hl2msg}}<br />
<br />
=== rocketpack_landed ===<br />
{{begin-hl2msg|rocketpack_landed|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== medic_defended ===<br />
{{begin-hl2msg|medic_defended|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|short|medic|}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_healed ===<br />
{{begin-hl2msg|localplayer_healed|string}}<br />
{{hl2msg|short|amount|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_destroyed_pipebomb ===<br />
{{begin-hl2msg|player_destroyed_pipebomb|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== object_deflected ===<br />
{{begin-hl2msg|object_deflected|string}}<br />
{{hl2msg|short|userid|player who deflected the object}}<br />
{{hl2msg|short|ownerid|owner of the object}}<br />
{{hl2msg|short|weaponid|weapon id (0 means the player in ownerid was pushed)}}<br />
{{hl2msg|byte|object_entindex|entindex of the object that got deflected}}<br />
{{end-hl2msg}}<br />
<br />
=== player_mvp ===<br />
{{begin-hl2msg|player_mvp|string}}<br />
{{hl2msg|short|player|}}<br />
{{end-hl2msg}}<br />
<br />
=== raid_spawn_mob ===<br />
{{begin-hl2msg|raid_spawn_mob|string}}<br />
{{end-hl2msg}}<br />
<br />
=== raid_spawn_squad ===<br />
{{begin-hl2msg|raid_spawn_squad|string}}<br />
{{end-hl2msg}}<br />
<br />
=== nav_blocked ===<br />
{{begin-hl2msg|nav_blocked|string}}<br />
{{hl2msg|long|area|}}<br />
{{hl2msg|bool|blocked|}}<br />
{{end-hl2msg}}<br />
<br />
=== path_track_passed ===<br />
{{begin-hl2msg|path_track_passed|string}}<br />
{{hl2msg|short|index|index of the node being passed}}<br />
{{end-hl2msg}}<br />
<br />
=== num_cappers_changed ===<br />
{{begin-hl2msg|num_cappers_changed|string}}<br />
{{hl2msg|short|index|index of the trigger}}<br />
{{hl2msg|byte|count|number of cappers (-1 for blocked)}}<br />
{{end-hl2msg}}<br />
<br />
=== player_regenerate ===<br />
{{begin-hl2msg|player_regenerate|string}}<br />
{{end-hl2msg}}<br />
<br />
=== update_status_item ===<br />
{{begin-hl2msg|update_status_item|string}}<br />
{{hl2msg|byte|index|}}<br />
{{hl2msg|byte|object|}}<br />
{{end-hl2msg}}<br />
<br />
=== stats_resetround ===<br />
{{begin-hl2msg|stats_resetround|string}}<br />
{{end-hl2msg}}<br />
<br />
=== scorestats_accumulated_update ===<br />
{{begin-hl2msg|scorestats_accumulated_update|string}}<br />
{{end-hl2msg}}<br />
<br />
=== scorestats_accumulated_reset ===<br />
{{begin-hl2msg|scorestats_accumulated_reset|string}}<br />
{{end-hl2msg}}<br />
<br />
=== achievement_earned_local ===<br />
{{begin-hl2msg|achievement_earned_local|string}}<br />
{{hl2msg|short|achievement|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_healed ===<br />
{{begin-hl2msg|player_healed|string}}<br />
{{hl2msg|short|patient|}}<br />
{{hl2msg|short|healer|}}<br />
{{hl2msg|short|amount|}}<br />
{{end-hl2msg}}<br />
<br />
=== building_healed ===<br />
{{begin-hl2msg|building_healed|string}}<br />
{{hl2msg|short|building|}}<br />
{{hl2msg|short|healer|}}<br />
{{hl2msg|short|amount|}}<br />
{{end-hl2msg}}<br />
<br />
=== item_pickup ===<br />
{{begin-hl2msg|item_pickup|string}}<br />
{{hl2msg|short|userid|}}<br />
{{hl2msg|string|item|}}<br />
{{end-hl2msg}}<br />
<br />
=== duel_status ===<br />
{{begin-hl2msg|duel_status|string}}<br />
{{hl2msg|short|killer|}}<br />
{{hl2msg|short|score_type|}}<br />
{{hl2msg|short|initiator|}}<br />
{{hl2msg|short|target|}}<br />
{{hl2msg|short|initiator_score|}}<br />
{{hl2msg|short|target_score|}}<br />
{{end-hl2msg}}<br />
<br />
=== fish_notice ===<br />
{{qnotice|clone of "player_death"}}<br><br />
{{begin-hl2msg|fish_notice|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{hl2msg|short|stun_flags|victim's stun flags at the moment of death}}<br />
{{hl2msg|short|death_flags|death flags.}}<br />
{{hl2msg|bool|silent_kill|}}<br />
{{hl2msg|string|assister_fallback|contains a string to use if "assister" is -1}}<br />
{{end-hl2msg}}<br />
<br />
=== fish_notice__arm ===<br />
{{qnotice|clone of "fish_notice" (...clone of "player_death"}}<br><br />
{{begin-hl2msg|fish_notice__arm|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{hl2msg|short|stun_flags|victim's stun flags at the moment of death}}<br />
{{hl2msg|short|death_flags|death flags.}}<br />
{{hl2msg|bool|silent_kill|}}<br />
{{hl2msg|string|assister_fallback|contains a string to use if "assister" is -1}}<br />
{{end-hl2msg}}<br />
<br />
=== slap_notice ===<br />
{{begin-hl2msg|fish_notice__arm|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{hl2msg|short|stun_flags|victim's stun flags at the moment of death}}<br />
{{hl2msg|short|death_flags|death flags.}}<br />
{{hl2msg|bool|silent_kill|}}<br />
{{hl2msg|string|assister_fallback|contains a string to use if "assister" is -1}}<br />
{{end-hl2msg}}<br />
<br />
<br />
=== throwable_hit ===<br />
{{qnotice|clone of "player_death" with added counts}}<br><br />
{{begin-hl2msg|throwable_hit|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|short|assister|user ID of assister}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{hl2msg|short|stun_flags|victim's stun flags at the moment of death}}<br />
{{hl2msg|short|death_flags|death flags.}}<br />
{{hl2msg|bool|silent_kill|}}<br />
{{hl2msg|string|assister_fallback|contains a string to use if "assister" is -1}}<br />
{{hl2msg|short|totalhits|Number of hits his player has done}}<br />
{{end-hl2msg}}<br />
<br />
=== pumpkin_lord_summoned ===<br />
{{begin-hl2msg|pumpkin_lord_summoned|string}}<br />
{{end-hl2msg}}<br />
<br />
=== pumpkin_lord_killed ===<br />
{{begin-hl2msg|pumpkin_lord_killed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_summoned ===<br />
{{begin-hl2msg|merasmus_summoned|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_killed ===<br />
{{begin-hl2msg|merasmus_summoned|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_escape_warning ===<br />
{{begin-hl2msg|merasmus_summoned|string}}<br />
{{hl2msg|short|level|}}<br />
{{hl2msg|byte|time_remaining|}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_escaped ===<br />
{{begin-hl2msg|merasmus_summoned|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_summoned ===<br />
{{begin-hl2msg|eyeball_boss_summoned|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_stunned ===<br />
{{begin-hl2msg|eyeball_boss_stunned|string}}<br />
{{hl2msg|short|level|}}<br />
{{hl2msg|byte|player_entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_killed ===<br />
{{begin-hl2msg|eyeball_boss_killed|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_killer ===<br />
{{begin-hl2msg|eyeball_boss_killer|string}}<br />
{{hl2msg|short|level|}}<br />
{{hl2msg|byte|player_entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_escape_imminent ===<br />
{{begin-hl2msg|eyeball_boss_escape_imminent|string}}<br />
{{hl2msg|short|level|}}<br />
{{hl2msg|byte|time_remaining|}}<br />
{{end-hl2msg}}<br />
<br />
=== eyeball_boss_escaped ===<br />
{{begin-hl2msg|eyeball_boss_escaped|string}}<br />
{{hl2msg|short|level|}}<br />
{{end-hl2msg}}<br />
<br />
=== npc_hurt ===<br />
{{begin-hl2msg|npc_hurt|string}}<br />
{{hl2msg|short|entindex|}}<br />
{{hl2msg|short|health|}}<br />
{{hl2msg|short|attacker_player|}}<br />
{{hl2msg|short|weaponid|}}<br />
{{hl2msg|short|damageamount|}}<br />
{{hl2msg|bool|crit|}}<br />
{{hl2msg|short|boss|1: Horsemann, 2: Monoculus, 3: Merasmus}}<br />
{{end-hl2msg}}<br />
<br />
=== controlpoint_timer_updated ===<br />
{{begin-hl2msg|controlpoint_timer_updated|string}}<br />
{{hl2msg|short|index|index of the cap being updated}}<br />
{{hl2msg|float|time|time}}<br />
{{end-hl2msg}}<br />
<br />
=== player_highfive_start ===<br />
{{begin-hl2msg|player_highfive_start|string}}<br />
{{hl2msg|byte|entindex|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== player_highfive_cancel ===<br />
{{begin-hl2msg|player_highfive_cancel|string}}<br />
{{hl2msg|byte|entindex|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== player_highfive_success ===<br />
{{begin-hl2msg|player_highfive_success|string}}<br />
{{hl2msg|byte|initiator_entindex|}}<br />
{{hl2msg|byte|partner_entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_bonuspoints ===<br />
{{begin-hl2msg|player_bonuspoints|string}}<br />
{{hl2msg|short|points|}}<br />
{{hl2msg|short|player_entindex|}}<br />
{{hl2msg|short|source_entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_upgraded ===<br />
{{qnotice|This event appears to be missing an argument for which player upgraded}}<br><br />
{{begin-hl2msg|player_upgraded|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_buyback ===<br />
{{begin-hl2msg|player_buyback|string}}<br />
{{hl2msg|short|player|}}<br />
{{hl2msg|short|cost|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_used_powerup_bottle ===<br />
{{begin-hl2msg|player_used_powerup_bottle|string}}<br />
{{hl2msg|short|player|}}<br />
{{hl2msg|short|type|}}<br />
{{hl2msg|float|time|}}<br />
{{end-hl2msg}}<br />
<br />
=== christmas_gift_grab ===<br />
{{begin-hl2msg|christmas_gift_grab|string}}<br />
{{hl2msg|short|userid|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_killed_achievement_zone ===<br />
{{begin-hl2msg|player_killed_achievement_zone|string}}<br />
{{hl2msg|short|attacker|entindex of the attacker}}<br />
{{hl2msg|short|victim|entindex of the victim}}<br />
{{hl2msg|short|zone_id|type of area (0 for general, 1 for capture zone)}}<br />
{{end-hl2msg}}<br />
<br />
=== party_updated ===<br />
{{begin-hl2msg|party_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== party_pref_changed ===<br />
{{begin-hl2msg|party_pref_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== party_criteria_changed ===<br />
{{begin-hl2msg|party_criteria_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== party_invites_changed ===<br />
{{begin-hl2msg|party_invites_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== party_queue_state_changed ===<br />
{{begin-hl2msg|party_queue_state_changed|string}}<br />
{{hl2msg|short|matchgroup|ETFMatchGroup}}<br />
{{end-hl2msg}}<br />
<br />
=== party_chat ===<br />
{{begin-hl2msg|party_chat|string}}<br />
{{hl2msg|string|steamid|steamID (64-bit value converted to string) of user who said or did the thing. May be empty-string for system actor.}}<br />
{{hl2msg|string|text|The message. May have different meaning for some types}}<br />
{{hl2msg|short|type|What sort of message? ETFPartyChatType enum}}<br />
{{end-hl2msg}}<br />
<br />
=== party_member_join ===<br />
{{begin-hl2msg|party_member_join|string}}<br />
{{hl2msg|string|steamid|steamID (64-bit value converted to string) of joined}}<br />
{{end-hl2msg}}<br />
<br />
=== party_member_leave ===<br />
{{begin-hl2msg|party_member_leave|string}}<br />
{{hl2msg|string|steamid|steamID (64-bit value converted to string) of leaver}}<br />
{{end-hl2msg}}<br />
<br />
=== match_invites_updated ===<br />
{{begin-hl2msg|match_invites_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== lobby_updated ===<br />
{{begin-hl2msg|lobby_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_mission_update ===<br />
{{begin-hl2msg|mvm_mission_update|string}}<br />
{{hl2msg|short|class|}}<br />
{{hl2msg|short|count|}}<br />
{{end-hl2msg}}<br />
<br />
=== recalculate_holidays ===<br />
{{begin-hl2msg|recalculate_holidays|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_currency_changed ===<br />
{{begin-hl2msg|player_currency_changed|string}}<br />
{{hl2msg|short|currency|}}<br />
{{end-hl2msg}}<br />
<br />
=== doomsday_rocket_open ===<br />
{{begin-hl2msg|doomsday_rocket_open|string}}<br />
{{hl2msg|byte|team|which team opened the rocket}}<br />
{{end-hl2msg}}<br />
<br />
=== remove_nemesis_relationships ===<br />
{{begin-hl2msg|remove_nemesis_relationships|string}}<br />
{{hl2msg|short|player|entindex of the player who should reset}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_creditbonus_wave ===<br />
{{begin-hl2msg|mvm_creditbonus_wave|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_creditbonus_all ===<br />
{{begin-hl2msg|mvm_creditbonus_all|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_creditbonus_all_advanced ===<br />
{{begin-hl2msg|mvm_creditbonus_all_advanced|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_quick_sentry_upgrade ===<br />
{{begin-hl2msg|mvm_quick_sentry_upgrade|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_tank_destroyed_by_players ===<br />
{{begin-hl2msg|mvm_tank_destroyed_by_players|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_kill_robot_delivering_bomb ===<br />
{{begin-hl2msg|mvm_kill_robot_delivering_bomb|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_pickup_currency ===<br />
{{begin-hl2msg|mvm_pickup_currency|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{hl2msg|short|currency|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_bomb_carrier_killed ===<br />
{{begin-hl2msg|mvm_bomb_carrier_killed|string}}<br />
{{hl2msg|short|level|upgrade level of the carrier}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_sentrybuster_detonate ===<br />
{{begin-hl2msg|mvm_sentrybuster_detonate|string}}<br />
{{hl2msg|short|player|entindex of the target playerr}}<br />
{{hl2msg|float|det_x|origin of the sentry buster}}<br />
{{hl2msg|float|det_y|}}<br />
{{hl2msg|float|det_z|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_scout_marked_for_death ===<br />
{{begin-hl2msg|mvm_scout_marked_for_death|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_medic_powerup_shared ===<br />
{{begin-hl2msg|mvm_medic_powerup_shared|string}}<br />
{{hl2msg|short|player|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_begin_wave ===<br />
{{begin-hl2msg|mvm_begin_wave|string}}<br />
{{hl2msg|short|wave_index|}}<br />
{{hl2msg|short|max_waves|}}<br />
{{hl2msg|short|advanced|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_wave_complete ===<br />
{{begin-hl2msg|mvm_wave_complete|string}}<br />
{{hl2msg|bool|advanced|is this an advanced popfile}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_mission_complete ===<br />
{{begin-hl2msg|mvm_mission_complete|string}}<br />
{{hl2msg|string|mission|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_bomb_reset_by_player ===<br />
{{begin-hl2msg|mvm_bomb_reset_by_player|string}}<br />
{{hl2msg|short|player|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_bomb_alarm_triggered ===<br />
{{begin-hl2msg|mvm_bomb_alarm_triggered|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_bomb_deploy_reset_by_player ===<br />
{{begin-hl2msg|mvm_bomb_deploy_reset_by_player|string}}<br />
{{hl2msg|short|player|}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_wave_failed ===<br />
{{begin-hl2msg|mvm_wave_failed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_reset_stats ===<br />
{{begin-hl2msg|mvm_reset_stats|string}}<br />
{{end-hl2msg}}<br />
<br />
=== damage_resisted ===<br />
{{begin-hl2msg|damage_resisted|string}}<br />
{{hl2msg|byte|entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== revive_player_notify ===<br />
{{begin-hl2msg|revive_player_notify|string}}<br />
{{hl2msg|short|entindex|}}<br />
{{hl2msg|short|marker_entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== revive_player_stopped ===<br />
{{begin-hl2msg|revive_player_stopped|string}}<br />
{{hl2msg|short|entindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== revive_player_complete ===<br />
{{begin-hl2msg|revive_player_complete|string}}<br />
{{hl2msg|short|entindex|entindex of the medic}}<br />
{{end-hl2msg}}<br />
<br />
=== player_turned_to_ghost ===<br />
{{begin-hl2msg|player_turned_to_ghost|string}}<br />
{{hl2msg|short|userid|user ID of the player who changed to a ghost}}<br />
{{end-hl2msg}}<br />
<br />
=== medigun_shield_blocked_damage ===<br />
{{begin-hl2msg|medigun_shield_blocked_damage|string}}<br />
{{hl2msg|short|userid|user ID of the player using the shield}}<br />
{{hl2msg|float|damage|damage that was blocked}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_adv_wave_complete_no_gates ===<br />
{{begin-hl2msg|mvm_adv_wave_complete_no_gates|string}}<br />
{{hl2msg|short|index|wave index}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_sniper_headshot_currency ===<br />
{{begin-hl2msg|mvm_sniper_headshot_currency|string}}<br />
{{hl2msg|short|userid|user ID of the player}}<br />
{{hl2msg|short|currency|currency collected}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_mannhattan_pit ===<br />
{{begin-hl2msg|mvm_mannhattan_pit|string}}<br />
{{end-hl2msg}}<br />
<br />
=== flag_carried_in_detection_zone ===<br />
{{begin-hl2msg|flag_carried_in_detection_zone|string}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_adv_wave_killed_stun_radio ===<br />
{{begin-hl2msg|mvm_adv_wave_killed_stun_radio|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_directhit_stun ===<br />
{{begin-hl2msg|player_directhit_stun|string}}<br />
{{hl2msg|short|attacker|entindex of the attacker}}<br />
{{hl2msg|short|victim|entindex of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== mvm_sentrybuster_killed ===<br />
{{begin-hl2msg|mvm_sentrybuster_killed|string}}<br />
{{hl2msg|short|sentry_buster|entindex}}<br />
{{end-hl2msg}}<br />
<br />
=== upgrades_file_changed ===<br />
{{begin-hl2msg|upgrades_file_changed|string}}<br />
{{hl2msg|string|path|}}<br />
{{end-hl2msg}}<br />
<br />
=== rd_team_points_changed ===<br />
{{begin-hl2msg|rd_team_points_changed|string}}<br />
{{hl2msg|short|points|}}<br />
{{hl2msg|byte|team|}}<br />
{{hl2msg|byte|method|}}<br />
{{end-hl2msg}}<br />
<br />
=== rd_rules_state_changed ===<br />
{{begin-hl2msg|rd_rules_state_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== rd_robot_killed ===<br />
{{qnotice|this extends the original player_death}}<br><br />
{{begin-hl2msg|rd_robot_killed|string}}<br />
{{hl2msg|short|userid|user ID who died}}<br />
{{hl2msg|long|victim_entindex|}}<br />
{{hl2msg|long|inflictor_entindex|ent index of inflictor (a sentry, for example)}}<br />
{{hl2msg|short|attacker|user ID who killed}}<br />
{{hl2msg|string|weapon|weapon name killer used}}<br />
{{hl2msg|short|weaponid|ID of weapon killed used}}<br />
{{hl2msg|long|damagebits|bits of type of damage}}<br />
{{hl2msg|short|customkill|type of custom kill}}<br />
{{hl2msg|string|weapon_logclassname|weapon name that should be printed on the log}}<br />
{{end-hl2msg}}<br />
<br />
=== rd_robot_impact ===<br />
{{begin-hl2msg|rd_robot_impact|string}}<br />
{{hl2msg|short|entindex|}}<br />
{{hl2msg|float|impulse_x|}}<br />
{{hl2msg|float|impulse_y|}}<br />
{{hl2msg|float|impulse_z|}}<br />
{{end-hl2msg}}<br />
<br />
=== teamplay_pre_round_time_left ===<br />
{{begin-hl2msg|teamplay_pre_round_time_left|string}}<br />
{{hl2msg|short|time|}}<br />
{{end-hl2msg}}<br />
<br />
=== parachute_deploy ===<br />
{{begin-hl2msg|parachute_deploy|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== parachute_holster ===<br />
{{begin-hl2msg|parachute_holster|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== kill_refills_meter ===<br />
{{begin-hl2msg|kill_refills_meter|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== rps_taunt_event ===<br />
{{begin-hl2msg|rps_taunt_event|string}}<br />
{{hl2msg|short|winner|entindex of the winning player}}<br />
{{hl2msg|byte|winner_rps|winner's selection}}<br />
{{hl2msg|short|loser|entindex of the losing player}}<br />
{{hl2msg|byte|loser_rps|loser's selection}}<br />
{{end-hl2msg}}<br />
<br />
=== conga_kill ===<br />
{{begin-hl2msg|kill_refills_meter|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== player_initial_spawn ===<br />
{{begin-hl2msg|player_initial_spawn|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{end-hl2msg}}<br />
<br />
=== competitive_victory ===<br />
{{begin-hl2msg|competitive_victory|string}}<br />
{{end-hl2msg}}<br />
<br />
=== competitive_stats_update ===<br />
{{begin-hl2msg|competitive_stats_update|string}}<br />
{{hl2msg|short|index|entindex of the player}}<br />
{{hl2msg|byte|kills_rank|num std deviations above}}<br />
{{hl2msg|byte|score_rank|}}<br />
{{hl2msg|byte|damage_rank|}}<br />
{{hl2msg|byte|healing_rank|}}<br />
{{hl2msg|byte|support_rank|}}<br />
{{end-hl2msg}}<br />
<br />
=== minigame_win ===<br />
{{begin-hl2msg|minigame_win|string}}<br />
{{hl2msg|byte|team|which team won the minigame}}<br />
{{hl2msg|byte|type|what type of minigame was won}}<br />
{{end-hl2msg}}<br />
<br />
=== sentry_on_go_active ===<br />
{{begin-hl2msg|sentry_on_go_active|string}}<br />
{{hl2msg|short|index|}}<br />
{{end-hl2msg}}<br />
<br />
=== duck_xp_level_up ===<br />
{{begin-hl2msg|duck_xp_level_up|string}}<br />
{{hl2msg|short|level|leveled up to what}}<br />
{{end-hl2msg}}<br />
<br />
=== questlog_opened ===<br />
{{begin-hl2msg|questlog_opened|string}}<br />
{{end-hl2msg}}<br />
<br />
=== schema_updated ===<br />
{{begin-hl2msg|schema_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== localplayer_pickup_weapon ===<br />
{{begin-hl2msg|localplayer_pickup_weapon|string}}<br />
{{end-hl2msg}}<br />
<br />
=== rd_player_score_points ===<br />
{{begin-hl2msg|rd_player_score_points|string}}<br />
{{hl2msg|short|player|}}<br />
{{hl2msg|short|method|}}<br />
{{hl2msg|short|amount|}}<br />
{{end-hl2msg}}<br />
<br />
=== demoman_det_stickies ===<br />
{{begin-hl2msg|demoman_det_stickies|string}}<br />
{{hl2msg|short|player|entindex of the detonating player}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_objective_completed ===<br />
{{qnotice|For prediction}}<br><br />
{{begin-hl2msg|quest_objective_completed|string}}<br />
{{hl2msg|long|quest_item_id_low|}}<br />
{{hl2msg|long|quest_item_id_hi|}}<br />
{{hl2msg|long|quest_objective_id|}}<br />
{{hl2msg|short|scorer_user_id|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_score_changed ===<br />
{{begin-hl2msg|player_score_changed|string}}<br />
{{hl2msg|byte|player|}}<br />
{{hl2msg|short|delta|}}<br />
{{end-hl2msg}}<br />
<br />
=== killed_capping_player ===<br />
{{begin-hl2msg|killed_capping_player|string}}<br />
{{hl2msg|byte|cp|index of the point}}<br />
{{hl2msg|byte|killer|index of the killer}}<br />
{{hl2msg|byte|victim|index of the victim}}<br />
{{hl2msg|byte|assister|index of the assister}}<br />
{{end-hl2msg}}<br />
<br />
=== environmental_death ===<br />
{{begin-hl2msg|environmental_death|string}}<br />
{{hl2msg|byte|killer|index of the killer}}<br />
{{hl2msg|byte|victim|index of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== projectile_direct_hit ===<br />
{{begin-hl2msg|projectile_direct_hit|string}}<br />
{{hl2msg|byte|attacker|index of the player who shot the projectile}}<br />
{{hl2msg|byte|victim|index of the player who got direct-hit}}<br />
{{hl2msg|long|weapon_def_index|defindex of the direct hitting weapon}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_get ===<br />
{{qnotice|When a player gets a neutral ball}}<br><br />
{{begin-hl2msg|pass_get|string}}<br />
{{hl2msg|short|owner|index of the player who got the ball}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_score ===<br />
{{qnotice|When a player scores with the ball}}<br />
{{begin-hl2msg|pass_score|string}}<br />
{{hl2msg|short|scorer|}}<br />
{{hl2msg|short|assister|}}<br />
{{hl2msg|byte|points|}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_free ===<br />
{{qnotice|When a player looses the ball}}<br><br />
{{begin-hl2msg|pass_free|string}}<br />
{{hl2msg|short|owner|}}<br />
{{hl2msg|short|attacker|}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_pass_caught ===<br />
{{qnotice|When a player catches the ball}}<br><br />
{{begin-hl2msg|pass_pass_caught|string}}<br />
{{hl2msg|short|passer|}}<br />
{{hl2msg|short|catcher|}}<br />
{{hl2msg|float|dist|}}<br />
{{hl2msg|float|duration|}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_ball_stolen ===<br />
{{qnotice|When a player melee steals the ball from another player}}<br><br />
{{begin-hl2msg|pass_ball_stolen|string}}<br />
{{hl2msg|short|victim|}}<br />
{{hl2msg|short|attacker|}}<br />
{{end-hl2msg}}<br />
<br />
=== pass_ball_blocked ===<br />
{{qnotice|When an enemy player blocks the without picking it up, via uber or rocket/sticky jumpers}}<br><br />
{{begin-hl2msg|pass_ball_blocked|string}}<br />
{{hl2msg|short|owner|}}<br />
{{hl2msg|short|blocker|}}<br />
{{end-hl2msg}}<br />
<br />
=== damage_prevented ===<br />
{{begin-hl2msg|damage_prevented|string}}<br />
{{hl2msg|short|preventor|Who prevented the damage}}<br />
{{hl2msg|short|victim|Who took the damage that was prevented}}<br />
{{hl2msg|short|amount|How much got prevented}}<br />
{{hl2msg|short|condition|Which condition did the preventing}}<br />
{{end-hl2msg}}<br />
<br />
=== halloween_boss_killed ===<br />
{{begin-hl2msg|halloween_boss_killed|string}}<br />
{{hl2msg|short|boss|1: Horsemann, 2: Monoculus, 3: Merasmus}}<br />
{{hl2msg|short|killer|userid of the killing player}}<br />
{{end-hl2msg}}<br />
<br />
=== escaped_loot_island ===<br />
{{begin-hl2msg|escaped_loot_island|string}}<br />
{{hl2msg|short|player|userid of the escaping player}}<br />
{{end-hl2msg}}<br />
<br />
=== tagged_player_as_it ===<br />
{{begin-hl2msg|tagged_player_as_it|string}}<br />
{{hl2msg|short|player|userid of the tagging player}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_stunned ===<br />
{{begin-hl2msg|merasmus_stunned|string}}<br />
{{hl2msg|short|player|userid of the stunning player}}<br />
{{end-hl2msg}}<br />
<br />
=== merasmus_prop_found ===<br />
{{begin-hl2msg|merasmus_prop_found|string}}<br />
{{hl2msg|short|player|userid of the player that found the prop Merasmus was hiding in}}<br />
{{end-hl2msg}}<br />
<br />
=== halloween_skeleton_killed ===<br />
{{begin-hl2msg|halloween_skeleton_killed|string}}<br />
{{hl2msg|short|player|userid of the player that killed the skeleton}}<br />
{{end-hl2msg}}<br />
<br />
=== escaped_hell ===<br />
{{begin-hl2msg|escaped_hell|string}}<br />
{{hl2msg|short|player|userid of the player that escaped}}<br />
{{end-hl2msg}}<br />
<br />
=== cross_spectral_bridge ===<br />
{{begin-hl2msg|cross_spectral_bridge|string}}<br />
{{hl2msg|short|player|userid of the player that crossed}}<br />
{{end-hl2msg}}<br />
<br />
=== minigame_won ===<br />
{{begin-hl2msg|minigame_won|string}}<br />
{{hl2msg|short|player|userid of the winning player}}<br />
{{hl2msg|short|game|index of the game}}<br />
{{end-hl2msg}}<br />
<br />
=== respawn_ghost ===<br />
{{begin-hl2msg|respawn_ghost|string}}<br />
{{hl2msg|short|reviver|userid of the reviving player}}<br />
{{hl2msg|short|ghost|userid of the player that got revived}}<br />
{{end-hl2msg}}<br />
<br />
=== kill_in_hell ===<br />
{{begin-hl2msg|kill_in_hell|string}}<br />
{{hl2msg|short|killer|userid of the killer}}<br />
{{hl2msg|short|victim|userid of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== halloween_duck_collected ===<br />
{{begin-hl2msg|halloween_duck_collected|string}}<br />
{{hl2msg|short|collector|userid of the collecting player}}<br />
{{end-hl2msg}}<br />
<br />
=== special_score ===<br />
{{begin-hl2msg|special_score|string}}<br />
{{hl2msg|byte|player|index of the scorer}}<br />
{{end-hl2msg}}<br />
<br />
=== team_leader_killed ===<br />
{{begin-hl2msg|team_leader_killed|string}}<br />
{{hl2msg|byte|killer|index of the killer}}<br />
{{hl2msg|byte|victim|index of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== halloween_soul_collected ===<br />
{{begin-hl2msg|halloween_duck_collected|string}}<br />
{{hl2msg|byte|intended_target|userid of the intended target}}<br />
{{hl2msg|byte|collecting_player|userid of the player who picked up the soul}}<br />
{{hl2msg|byte|soul_count|number of souls collected (gift boxes)}}<br />
{{end-hl2msg}}<br />
<br />
=== recalculate_truce ===<br />
{{begin-hl2msg|recalculate_truce|string}}<br />
{{end-hl2msg}}<br />
<br />
=== deadringer_cheat_death ===<br />
{{begin-hl2msg|deadringer_cheat_death|string}}<br />
{{hl2msg|byte|spy|userid of the Spy that cheat the death}}<br />
{{hl2msg|byte|attacker|userid of the player that caused the cheat death to happen}}<br />
{{end-hl2msg}}<br />
<br />
=== crossbow_heal ===<br />
{{begin-hl2msg|crossbow_heal|string}}<br />
{{hl2msg|byte|healer|userid of the Healer}}<br />
{{hl2msg|byte|target|userid of the player that got hit}}<br />
{{hl2msg|short|amount|amount that was healed}}<br />
{{end-hl2msg}}<br />
<br />
=== damage_mitigated ===<br />
{{begin-hl2msg|damage_mitigated|string}}<br />
{{hl2msg|byte|mitigator|userid of the player who provided the mitigation}}<br />
{{hl2msg|byte|damaged|userid of the player who took the damage}}<br />
{{hl2msg|short|amount|amount that was mitigated}}<br />
{{hl2msg|short|itemdefindex|defindex of the item that provided the mitigation}}<br />
{{end-hl2msg}}<br />
<br />
=== payload_pushed ===<br />
{{begin-hl2msg|payload_pushed|string}}<br />
{{hl2msg|byte|pusher|userid of the player who pushed}}<br />
{{hl2msg|short|distance|how far they pushed}}<br />
{{end-hl2msg}}<br />
<br />
=== player_abandoned_match ===<br />
{{begin-hl2msg|player_abandoned_match|string}}<br />
{{hl2msg|bool|game_over|}}<br />
{{end-hl2msg}}<br />
<br />
=== cl_drawline ===<br />
{{begin-hl2msg|cl_drawline|string}}<br />
{{hl2msg|byte|player|index of the player}}<br />
{{hl2msg|byte|panel|type of panel}}<br />
{{hl2msg|byte|line|type of line}}<br />
{{hl2msg|float|x|}}<br />
{{hl2msg|float|y|}}<br />
{{end-hl2msg}}<br />
<br />
=== restart_timer_time ===<br />
{{begin-hl2msg|restart_timer_time|string}}<br />
{{hl2msg|byte|time|How much time is left}}<br />
{{end-hl2msg}}<br />
<br />
=== winlimit_changed ===<br />
{{begin-hl2msg|winlimit_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== winpanel_show_scores ===<br />
{{begin-hl2msg|winpanel_show_scores|string}}<br />
{{end-hl2msg}}<br />
<br />
=== top_streams_request_finished ===<br />
{{begin-hl2msg|top_streams_request_finished|string}}<br />
{{end-hl2msg}}<br />
<br />
=== competitive_state_changed ===<br />
{{begin-hl2msg|competitive_state_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== global_war_data_updated ===<br />
{{begin-hl2msg|global_war_data_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== stop_watch_changed ===<br />
{{begin-hl2msg|stop_watch_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== ds_stop ===<br />
{{begin-hl2msg|ds_stop|string}}<br />
{{end-hl2msg}}<br />
<br />
=== ds_screenshot ===<br />
{{begin-hl2msg|ds_screenshot|string}}<br />
{{hl2msg|float|delay|}}<br />
{{end-hl2msg}}<br />
<br />
=== show_match_summary ===<br />
{{begin-hl2msg|show_match_summary|string}}<br />
{{end-hl2msg}}<br />
<br />
=== experience_changed ===<br />
{{begin-hl2msg|experience_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== begin_xp_lerp ===<br />
{{qnotice|Really only for debugging}}<br><br />
{{begin-hl2msg|begin_xp_lerp|string}}<br />
{{end-hl2msg}}<br />
<br />
=== matchmaker_stats_updated ===<br />
{{begin-hl2msg|matchmaker_stats_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== rematch_vote_period_over ===<br />
{{begin-hl2msg|rematch_vote_period_over|string}}<br />
{{hl2msg|bool|success|}}<br />
{{end-hl2msg}}<br />
<br />
=== rematch_failed_to_create ===<br />
{{begin-hl2msg|rematch_failed_to_create|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_rematch_change ===<br />
{{begin-hl2msg|player_rematch_change|string}}<br />
{{end-hl2msg}}<br />
<br />
=== ping_updated ===<br />
{{begin-hl2msg|ping_updated|string}}<br />
{{end-hl2msg}}<br />
<br />
=== player_next_map_vote_change ===<br />
{{begin-hl2msg|player_next_map_vote_change|string}}<br />
{{hl2msg|byte|map_index|what they voted for}}<br />
{{hl2msg|byte|vote|what the vote was}}<br />
{{end-hl2msg}}<br />
<br />
=== vote_maps_changed ===<br />
{{begin-hl2msg|vote_maps_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== proto_def_changed ===<br />
{{begin-hl2msg|proto_def_changed|string}}<br />
{{hl2msg|byte|type|}}<br />
{{hl2msg|long|defindex|}}<br />
{{hl2msg|bool|created|}}<br />
{{hl2msg|bool|deleted|}}<br />
{{hl2msg|bool|erase_history|}}<br />
{{end-hl2msg}}<br />
<br />
=== player_domination ===<br />
{{begin-hl2msg|player_domination|string}}<br />
{{hl2msg|short|dominator|userID of who gained domination}}<br />
{{hl2msg|short|dominated|userID of who got dominated}}<br />
{{hl2msg|short|dominations|Number of dominations this dominator has}}<br />
{{end-hl2msg}}<br />
<br />
=== player_rocketpack_pushed ===<br />
{{begin-hl2msg|player_rocketpack_pushed|string}}<br />
{{hl2msg|short|pusher|userID of who pushed}}<br />
{{hl2msg|short|pushed|userID of who got pushed}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_request ===<br />
{{begin-hl2msg|quest_request|string}}<br />
{{hl2msg|long|request|}}<br />
{{hl2msg|string|msg|Protobuf serialized to a string}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_response ===<br />
{{begin-hl2msg|quest_response|string}}<br />
{{hl2msg|long|request|}}<br />
{{hl2msg|bool|success|}}<br />
{{hl2msg|string|msg|Protobuf serialized to a string}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_progress ===<br />
{{begin-hl2msg|quest_progress|string}}<br />
{{hl2msg|short|owner|}}<br />
{{hl2msg|short|scorer|}}<br />
{{hl2msg|byte|type|}}<br />
{{hl2msg|bool|completed|}}<br />
{{hl2msg|long|quest_defindex|}}<br />
{{end-hl2msg}}<br />
<br />
=== projectile_removed ===<br />
{{begin-hl2msg|projectile_removed|string}}<br />
{{hl2msg|byte|attacker|}}<br />
{{hl2msg|long|weapon_def_index|}}<br />
{{hl2msg|byte|num_hit|}}<br />
{{hl2msg|byte|num_direct_hit|}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_map_data_changed ===<br />
{{begin-hl2msg|quest_map_data_changed|string}}<br />
{{end-hl2msg}}<br />
<br />
=== gas_doused_player_ignited ===<br />
{{begin-hl2msg|gas_doused_player_ignited|string}}<br />
{{hl2msg|short|igniter|entindex of the igniter}}<br />
{{hl2msg|short|douser|entindex of the douser}}<br />
{{hl2msg|short|victim|entindex of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== quest_turn_in_state ===<br />
{{begin-hl2msg|quest_turn_in_state|string}}<br />
{{hl2msg|short|state|Maps to EQuestTurnInState}}<br />
{{end-hl2msg}}<br />
<br />
=== items_acknowledged ===<br />
{{begin-hl2msg|items_acknowledged|string}}<br />
{{end-hl2msg}}<br />
<br />
=== capper_killed ===<br />
{{begin-hl2msg|capper_killed|string}}<br />
{{hl2msg|short|blocker|entindex of the blocker}}<br />
{{hl2msg|short|victim|entindex of the victim}}<br />
{{end-hl2msg}}<br />
<br />
=== mainmenu_stabilized ===<br />
{{begin-hl2msg|mainmenu_stabilized|string}}<br />
{{end-hl2msg}}<br />
<br />
=== world_status_changed ===<br />
{{begin-hl2msg|world_status_changed|string}}<br />
{{end-hl2msg}}</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=How_to_load_plugins_without_restarting_the_server&diff=10804How to load plugins without restarting the server2019-09-03T03:28:18Z<p>Naleksuh: Naleksuh moved page Loading plugins without restarting the server(SourceMod) to How to load plugins without restarting the server</p>
<hr />
<div><br />
<h2>How to load plugins without restarting the server</h2><br />
<br />
<br />
4. Execute "sm_ rcon sm plugin load YourPluginsName" in console where "YourPluginsName" is the name of your plugin. <br /><br />
'''Important:''' If your plugin's name has a dot in it, you must add ".smx" at the end of your plugin's name.<br />
<br /><br />
<b>Examples:</b><br />
* <code>sm_rcon sm plugins load myplugin</code> Will work because the plugin's name doesn't have a dot in it<br />
* <code>sm_rcon sm plugins load my.plugin</code> Won't work because the plugin's name has a dot in it<br />
* <code>rcon sm plugins load my.plugin.smx</code> Will work because even though there is a dot in the plugin's name there is ".smx" at the end of the plugin's name<br />
<br /><br />
<br />
If you need to unload your plugins simply type "unload" instead of "load".<br /><br />
If you need a full list of SourceMod plugins commands just type "sm_rcon sm plugins list" in console.</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=Loading_plugins_without_restarting_the_server(SourceMod)&diff=10805Loading plugins without restarting the server(SourceMod)2019-09-03T03:28:18Z<p>Naleksuh: Naleksuh moved page Loading plugins without restarting the server(SourceMod) to How to load plugins without restarting the server</p>
<hr />
<div>#REDIRECT [[How to load plugins without restarting the server]]</div>Naleksuhhttps://wiki.alliedmods.net/index.php?title=How_to_load_plugins_without_restarting_the_server&diff=10803How to load plugins without restarting the server2019-09-03T03:28:01Z<p>Naleksuh: </p>
<hr />
<div><br />
<h2>How to load plugins without restarting the server</h2><br />
<br />
<br />
4. Execute "sm_ rcon sm plugin load YourPluginsName" in console where "YourPluginsName" is the name of your plugin. <br /><br />
'''Important:''' If your plugin's name has a dot in it, you must add ".smx" at the end of your plugin's name.<br />
<br /><br />
<b>Examples:</b><br />
* <code>sm_rcon sm plugins load myplugin</code> Will work because the plugin's name doesn't have a dot in it<br />
* <code>sm_rcon sm plugins load my.plugin</code> Won't work because the plugin's name has a dot in it<br />
* <code>rcon sm plugins load my.plugin.smx</code> Will work because even though there is a dot in the plugin's name there is ".smx" at the end of the plugin's name<br />
<br /><br />
<br />
If you need to unload your plugins simply type "unload" instead of "load".<br /><br />
If you need a full list of SourceMod plugins commands just type "sm_rcon sm plugins list" in console.</div>Naleksuh