<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ProdigySim</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=ProdigySim"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/ProdigySim"/>
	<updated>2026-04-28T04:14:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Clients_(SourceMod_Scripting)&amp;diff=11118</id>
		<title>Clients (SourceMod Scripting)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Clients_(SourceMod_Scripting)&amp;diff=11118"/>
		<updated>2020-10-16T19:50:24Z</updated>

		<summary type="html">&lt;p&gt;ProdigySim: Created page with &amp;quot;SourceMod assigns a Client Index number to client in the server. You can use these numbers to refer to specific clients in various SourceMod APIs. In particular, the [Clie...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SourceMod]] assigns a Client Index number to client in the server. You can use these numbers to refer to specific clients in various SourceMod APIs. In particular, the [Clients APIs https://sm.alliedmods.net/new-api/clients].&lt;br /&gt;
&lt;br /&gt;
The server is given client index 0, and the first connected user will have client index 1.&lt;br /&gt;
&lt;br /&gt;
There are two variables that can be used to talk about the maximum number of clients:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;MaxClients&amp;lt;/tt&amp;gt;: The maximum number of players currently allowed to connect to the server.&lt;br /&gt;
** This is set at runtime based on &amp;lt;tt&amp;gt;gpGlobals-&amp;gt;maxClients&amp;lt;/tt&amp;gt; in the game server.&lt;br /&gt;
* &amp;lt;tt&amp;gt;MAXPLAYERS&amp;lt;/tt&amp;gt;: The theoretical maximum number of clients allowed on any Source game.&lt;br /&gt;
** This number is set to 65, enough for 64 players + a SourceTV client.&lt;br /&gt;
&lt;br /&gt;
These values represent the '''maximum count of clients'''. Since Client indexing starts at 1, be wary of off-by-one errors here!&lt;br /&gt;
&lt;br /&gt;
It's recommended that you use &amp;lt;tt&amp;gt;&amp;amp;lt;= MaxClients&amp;lt;/tt&amp;gt; when looping through the client list, and &amp;lt;tt&amp;gt;MAXPLAYERS+1&amp;lt;/tt&amp;gt; when initializing an array to contain data for individual clients.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;sourcepawn&amp;gt;&lt;br /&gt;
// Declare static arrays to support the maximum number of clients possible.&lt;br /&gt;
new playerVotes[MAXPLAYERS+1];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public void OnPluginStart()&lt;br /&gt;
{&lt;br /&gt;
    RegConsoleCmd(&amp;quot;start_vote&amp;quot;, Command_StartVote);&lt;br /&gt;
    RegConsoleCmd(&amp;quot;vote&amp;quot;, Command_Vote);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public Action Command_StartVote(int client, int args)&lt;br /&gt;
{&lt;br /&gt;
  // Loop through all clients based on current number of max clients.&lt;br /&gt;
  for(int i = 0; i &amp;lt;= MaxClients; i++) {&lt;br /&gt;
    playerVotes[i] = 0;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public Action Command_Vote(int client, int args)&lt;br /&gt;
{&lt;br /&gt;
    char arg[128];&lt;br /&gt;
    if( args &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        GetCmdArg(i, arg, sizeof(arg));&lt;br /&gt;
        // Associate data with clients at their client index in an array.&lt;br /&gt;
        playerVotes[client] = StringToInt(arg);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return Plugin_Handled;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/sourcepawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes:&lt;br /&gt;
&lt;br /&gt;
The game engine's CBaseServer has its own &amp;lt;tt&amp;gt;m_clients&amp;lt;/tt&amp;gt; list. You can subtract 1 from a SourceMod client index to get the &amp;lt;tt&amp;gt;CBaseServer::m_clients&amp;lt;/tt&amp;gt; index.&lt;/div&gt;</summary>
		<author><name>ProdigySim</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SDKTools_(SourceMod_Scripting)&amp;diff=8861</id>
		<title>SDKTools (SourceMod Scripting)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SDKTools_(SourceMod_Scripting)&amp;diff=8861"/>
		<updated>2013-02-27T11:00:08Z</updated>

		<summary type="html">&lt;p&gt;ProdigySim: Adding more info about Address functions and examples.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The SDKTools extension is an extension for various functions provided by the Source SDK.  Additionally, it has the ability to dynamically call many C++ functions in the SDK, for example, from CBaseEntity or any derived class.&lt;br /&gt;
&lt;br /&gt;
SDKTools contains simplified versions of SDK functions pre-written for ease of use.  These can be found in the additional include files:&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdktools_functions.inc&amp;lt;/tt&amp;gt; - Popular functions from the SDK.&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdktools_sound.inc&amp;lt;/tt&amp;gt; - [[#Sound Functions|Sound-related functions]].&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdktools_tempents.inc&amp;lt;/tt&amp;gt; - [[#TempEnt Functions|TempEnt-related functions]].&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdktools_tempents_stocks.inc&amp;lt;/tt&amp;gt; - [[TempEnts (SourceMod SDKTools)|TempEnt Stocks for convenience]].&lt;br /&gt;
&lt;br /&gt;
SDKTools is powered by &amp;quot;BinTools,&amp;quot; a powerful extension for creating dynamic C/C++ calls.  BinTools is automatically loaded by SDKTools.&lt;br /&gt;
&lt;br /&gt;
=GameConfigs=&lt;br /&gt;
GameConfig files go into the &amp;quot;gamedata&amp;quot; folder under &amp;quot;sourcemod.&amp;quot;  In older revisions it was under &amp;quot;sourcemod/configs&amp;quot; which is now deprecated.&lt;br /&gt;
&lt;br /&gt;
==Virtual Offsets==&lt;br /&gt;
For adding virtual offsets, add sub-sections to the &amp;quot;Offsets&amp;quot; section of your game config file.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Games&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;cstrike&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;Offsets&amp;quot;&lt;br /&gt;
		{&lt;br /&gt;
			&amp;quot;GiveNamedItem&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;windows&amp;quot;	&amp;quot;329&amp;quot;&lt;br /&gt;
				&amp;quot;linux&amp;quot;		&amp;quot;330&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
			&amp;quot;EyePosition&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;windows&amp;quot;	&amp;quot;117&amp;quot;&lt;br /&gt;
				&amp;quot;linux&amp;quot;		&amp;quot;118&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Signature Scans==&lt;br /&gt;
For automated signature scans, add sub-sections to the &amp;quot;Signatures&amp;quot; section of your game config file.  There are three properties for a signature:&lt;br /&gt;
*&amp;lt;tt&amp;gt;library&amp;lt;/tt&amp;gt;: Must be &amp;quot;server&amp;quot; right now.&lt;br /&gt;
*&amp;lt;tt&amp;gt;windows&amp;lt;/tt&amp;gt;: A signature written in binary; for example, &amp;quot;\x56&amp;quot; instead of &amp;quot;0x56&amp;quot; -- the '*' character is a single byte wildcard.&lt;br /&gt;
*&amp;lt;tt&amp;gt;linux&amp;lt;/tt&amp;gt;: Either a signature as with &amp;lt;tt&amp;gt;windows&amp;lt;/tt&amp;gt;, or a named symbol.  To use a named symbol, start the string with the '@' character.  If a signature begins with '@', write the character in hexadecimal as above.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Games&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;cstrike&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;Signatures&amp;quot;&lt;br /&gt;
		{&lt;br /&gt;
			&amp;quot;RoundRespawn&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;library&amp;quot;	&amp;quot;server&amp;quot;&lt;br /&gt;
				&amp;quot;windows&amp;quot;	&amp;quot;\x56\x8B\xF1\x8B\x06\xFF\x90*\x04\x00\x00\x8B\x86*\x0D\x00&amp;quot;&lt;br /&gt;
				&amp;quot;linux&amp;quot;		&amp;quot;@_ZN9CCSPlayer12RoundRespawnEv&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Raw address lookups==&lt;br /&gt;
Lets you peek and poke (limitation may apply) the Source Dedicated Server memory space, and get a raw address value in an automated way.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Games&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;left4dead2&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;Addresses&amp;quot;&lt;br /&gt;
		{&lt;br /&gt;
			&amp;quot;CDirector&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;windows&amp;quot;&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;signature&amp;quot; &amp;quot;DirectorMusicBanks_OnRoundStart&amp;quot;&lt;br /&gt;
					&amp;quot;read&amp;quot; &amp;quot;8&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
				&amp;quot;linux&amp;quot;&lt;br /&gt;
				{&lt;br /&gt;
					&amp;quot;signature&amp;quot; &amp;quot;TheDirector&amp;quot;&lt;br /&gt;
				}&lt;br /&gt;
				&amp;quot;read&amp;quot; &amp;quot;0&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		&amp;quot;Signatures&amp;quot;&lt;br /&gt;
		{&lt;br /&gt;
			/* Used solely to get the offset for TheDirector */&lt;br /&gt;
			&amp;quot;DirectorMusicBanks_OnRoundStart&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;library&amp;quot;	&amp;quot;server&amp;quot;&lt;br /&gt;
				&amp;quot;windows&amp;quot;       &amp;quot;\x83\xEC\x14\x57\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x53\x55\x6A\x24\xE8&amp;quot;&lt;br /&gt;
				/* 83 EC 14 57 8B F9 8B 0D ? ? ? ? E8 ? ? ? ? 84 C0 0F ? ? ? ? ? 53 55 6A 24 E8 */&lt;br /&gt;
			}&lt;br /&gt;
			&lt;br /&gt;
			/* Find the Director/ZombieManager singleton classes */&lt;br /&gt;
			&lt;br /&gt;
			&amp;quot;TheDirector&amp;quot;&lt;br /&gt;
			{&lt;br /&gt;
				&amp;quot;library&amp;quot;	&amp;quot;server&amp;quot;&lt;br /&gt;
				&amp;quot;linux&amp;quot;		&amp;quot;@TheDirector&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data in an Address entry is parse from top to bottom as commands. This example would accomplish the same thing as the following pseudo-C++ code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BYTE * GetCDirectorAddress()&lt;br /&gt;
{&lt;br /&gt;
    BYTE * pAddr;&lt;br /&gt;
&lt;br /&gt;
#if WINDOWS&lt;br /&gt;
&lt;br /&gt;
    pAddr = FindSignature(&amp;quot;DirectorMusicBanks_OnRoundStart&amp;quot;);&lt;br /&gt;
    pAddr = *(pAddr + 8);&lt;br /&gt;
&lt;br /&gt;
#elif LINUX&lt;br /&gt;
&lt;br /&gt;
    pAddr = FindSignature(&amp;quot;TheDirector&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    pAddr = *(pAddr + 0);&lt;br /&gt;
&lt;br /&gt;
    return pAddr;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To invoke this address lookup in your Sourcepawn code, you would simply set up your GameConf handle and run something like the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stock Address:GetTheDirector()&lt;br /&gt;
{&lt;br /&gt;
   return GameConfGetAddress(g_hMyGameConf, &amp;quot;CDirector&amp;quot;);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more code examples, [https://github.com/confoglteam/l4d2_direct l4d2_direct] relies heavily on Address: functions.&lt;br /&gt;
&lt;br /&gt;
==Inheritance==&lt;br /&gt;
If you wish for multiple mods to inherit from one block, you can add a special &amp;quot;#supported&amp;quot; section under a &amp;quot;#default&amp;quot; section.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Games&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;#default&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;#supported&amp;quot;&lt;br /&gt;
		{&lt;br /&gt;
			&amp;quot;game&amp;quot;		&amp;quot;dod&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This specifies that the given block will be read for Day of Defeat as well.&lt;br /&gt;
&lt;br /&gt;
=Calling Functions=&lt;br /&gt;
Calling functions is complicated and requires strict attention to the C++ API you are trying to use.  If you make a mistake, something bad '''will''' happen (and if not, you got lucky!)  SDKTools is more complicated than PimpinJuice's &amp;quot;Hacks&amp;quot; extension because it precompiles all of the information needed to convert from Plugin memory to C++ types.  This precompilation step ensures better safety and speed, but it lengthens the preparation process.&lt;br /&gt;
&lt;br /&gt;
With that said, let's look at an overview of the call creation process.  Before making calls, we must ''prepare'' the call.  This will give us a &amp;lt;tt&amp;gt;Handle&amp;lt;/tt&amp;gt; which will let us make as many calls as we like.&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Init&amp;lt;/b&amp;gt; - The preparation must be initialized.  Here we can specify the calling convention, which is either static, or BaseEntity/BasePlayer-based.  BasePlayer should be used when only player entities should be allowed as the &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; pointer.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Destination&amp;lt;/b&amp;gt; - The call must have a destination address or virtual index to use.  This is normally done via &amp;lt;tt&amp;gt;PrepSDKCall_SetFromConf&amp;lt;/tt&amp;gt; which ties into gameconf files.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Return Info&amp;lt;/b&amp;gt; - If the call has return information, it must be set via &amp;lt;tt&amp;gt;PrepSDKCall_SetReturnInfo&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Parameters&amp;lt;/b&amp;gt; - Each parameter (if any) must be added with &amp;lt;tt&amp;gt;PrepSDKCall_AddParameter&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Finalize&amp;lt;/b&amp;gt; - The call must be finalized with &amp;lt;tt&amp;gt;EndPrepSDKCall&amp;lt;/tt&amp;gt;, which will return a &amp;lt;tt&amp;gt;Handle&amp;lt;/tt&amp;gt;.  If it doesn't, one or more of the preparation operations failed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the examples below, consider a plugin called &amp;quot;sdkexamples.sp&amp;quot; which has a gamedata file of &amp;quot;plugin.sdkexamples.txt&amp;quot; containing the definitions in the first section.&lt;br /&gt;
&lt;br /&gt;
==RoundRespawn Example==&lt;br /&gt;
CCSPlayer::RoundRespawn is a Counter-Strike Source function which respawns players.  It used by CS:S DM.  Prototype:&lt;br /&gt;
&amp;lt;pre&amp;gt;void CCSPlayer::RoundRespawn()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SDKCall example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#include &amp;lt;sourcemod&amp;gt;&lt;br /&gt;
#include &amp;lt;sdktools&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new Handle:hGameConf;&lt;br /&gt;
new Handle:hRoundRespawn;&lt;br /&gt;
&lt;br /&gt;
public OnPluginStart()&lt;br /&gt;
{&lt;br /&gt;
	hGameConf = LoadGameConfigFile(&amp;quot;plugin.sdkexamples&amp;quot;);&lt;br /&gt;
	StartPrepSDKCall(SDKCall_Player);&lt;br /&gt;
	PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, &amp;quot;RoundRespawn&amp;quot;);&lt;br /&gt;
	hRoundRespawn = EndPrepSDKCall();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
RespawnPlayer(client)&lt;br /&gt;
{&lt;br /&gt;
	SDKCall(hRoundRespawn, client);&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we did not have to set any extra information for parameters or return info, since CCSPlayer::RoundRespawn has no parameters and has a void return.&lt;br /&gt;
&lt;br /&gt;
==GiveNamedItem Example==&lt;br /&gt;
GiveNamedItem will give a player a named item.  Prototype:&lt;br /&gt;
&amp;lt;pre&amp;gt;virtual CBaseEntity *CBasePlayer::GiveNamedItem(const char *item, int iSubType = 0);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;#include &amp;lt;sourcemod&amp;gt;&lt;br /&gt;
#include &amp;lt;sdktools&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new Handle:hGameConf;&lt;br /&gt;
new Handle:hGiveNamedItem;&lt;br /&gt;
&lt;br /&gt;
public OnPluginStart()&lt;br /&gt;
{&lt;br /&gt;
	hGameConf = LoadGameConfigFile(&amp;quot;plugin.sdkexamples&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	StartPrepSDKCall(SDKCall_Player);&lt;br /&gt;
	PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, &amp;quot;GiveNamedItem&amp;quot;);&lt;br /&gt;
	PrepSDKCall_SetReturnInfo(SDKType_CBaseEntity, SDKPass_Pointer);&lt;br /&gt;
	PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);&lt;br /&gt;
	PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);&lt;br /&gt;
	hGiveNamedItem = EndPrepSDKCall();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
GiveItem(client, const String:item[])&lt;br /&gt;
{&lt;br /&gt;
	return SDKCall(hGiveNamedItem, client, item, 0);&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetEyePosition Example==&lt;br /&gt;
Prototype:&lt;br /&gt;
&amp;lt;pre&amp;gt;virtual Vector CBaseEntity::EyePosition();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;#include &amp;lt;sourcemod&amp;gt;&lt;br /&gt;
#include &amp;lt;sdktools&amp;gt;&lt;br /&gt;
&lt;br /&gt;
new Handle:hGameConf;&lt;br /&gt;
new Handle:hGetEyePosition;&lt;br /&gt;
&lt;br /&gt;
public OnPluginStart()&lt;br /&gt;
{&lt;br /&gt;
	hGameConf = LoadGameConfigFile(&amp;quot;plugin.sdkexamples&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	StartPrepSDKCall(SDKCall_Player);&lt;br /&gt;
	PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, &amp;quot;EyePosition&amp;quot;);&lt;br /&gt;
	PrepSDKCall_SetReturnInfo(SDKType_Vector, SDKPass_ByValue);&lt;br /&gt;
	hGetEyePosition= EndPrepSDKCall();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
GetEyePosition(client, Float:pos[3])&lt;br /&gt;
{&lt;br /&gt;
	SDKCall(hGetEyePosition, client, pos);&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the vector is returned as the third parameter (first parameter after the &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; pointer).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=TempEnt Functions=&lt;br /&gt;
TempEnts, also called &amp;quot;temporary entities,&amp;quot; &amp;quot;tempentities,&amp;quot; or &amp;quot;TEs,&amp;quot; are quick graphical displays that are too simple to justify the overhead of a &amp;lt;tt&amp;gt;CBaseEntity&amp;lt;/tt&amp;gt; instantiation or full server-side networkability.  In the SDK, they are statically defined instances that can be &amp;quot;played back&amp;quot; to the client by simply sending a copy of its network class properties.&lt;br /&gt;
&lt;br /&gt;
Temporary Entities are mod-dependent, in that a mod can change any of their properties or even the &amp;lt;tt&amp;gt;ITempEnts&amp;lt;/tt&amp;gt; class definition.  Because of this, SourceMod takes a very flexible approach:&lt;br /&gt;
*&amp;lt;b&amp;gt;First&amp;lt;/b&amp;gt;, a temp entity is ''started'' by name using &amp;lt;tt&amp;gt;TE_Start&amp;lt;/tt&amp;gt;.  A list of all tempent names and their network classes can be dumped with &amp;lt;tt&amp;gt;sm_print_telist&amp;lt;/tt&amp;gt; (SDKTools must be loaded).&lt;br /&gt;
*&amp;lt;b&amp;gt;Second&amp;lt;/b&amp;gt;, all of the tempent's properties are set via the &amp;lt;tt&amp;gt;TE_Write&amp;lt;/tt&amp;gt; natives.  All tempent properties can be dumped to a file using &amp;lt;tt&amp;gt;sm_dump_teprops&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;b&amp;gt;Third&amp;lt;/b&amp;gt;, the properties are transmitted using &amp;lt;tt&amp;gt;TE_Send&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;TE_SendToAll&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;TE_SendToClient&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As a convenience, SourceMod provides a number of pre-written stocks for SDK-defined temporary entities.  While the &amp;lt;tt&amp;gt;TE_*&amp;lt;/tt&amp;gt; natives are guaranteed to work on any fully-supported SourceMod mod, the &amp;lt;tt&amp;gt;TE_Setup*&amp;lt;/tt&amp;gt; stocks are not, as a mod might change the property layouts or the functionalities of the SDK-defined tempents.&lt;br /&gt;
&lt;br /&gt;
Some examples are below.  For pictures, see [[TempEnts (SourceMod SDKTools)]].&lt;br /&gt;
&lt;br /&gt;
Using stocks:&lt;br /&gt;
&amp;lt;pawn&amp;gt;SparkClient(client, const Float:pos[3], const Float:dir[3])&lt;br /&gt;
{&lt;br /&gt;
	TE_SetupMetalSparks(pos, dir);&lt;br /&gt;
	TE_SendToClient(client);&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not using stocks:&lt;br /&gt;
&amp;lt;pawn&amp;gt;SparkClient(client, const Float:pos[3], const Float:dir[3])&lt;br /&gt;
{&lt;br /&gt;
	TE_Start(&amp;quot;Metal Sparks&amp;quot;);&lt;br /&gt;
	TE_WriteVector(&amp;quot;m_vecPos&amp;quot;, pos);&lt;br /&gt;
	TE_WriteVector(&amp;quot;m_vecDir&amp;quot;, dir);&lt;br /&gt;
	TE_SendToClient(client);&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Sound Functions=&lt;br /&gt;
SDKTools exposes various sound-related members of IVEngineServer and IEngineSound.  The basic functions are in &amp;lt;tt&amp;gt;sdktools_sound.inc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
*&amp;lt;tt&amp;gt;EmitAmbientSound&amp;lt;/tt&amp;gt;: Plays an ambient sound from an origin.&lt;br /&gt;
*&amp;lt;tt&amp;gt;EmitSound, EmitSoundToClient, EmitSoundToAll&amp;lt;/tt&amp;gt;: Plays a sound to a list of clients from a specific entity.&lt;br /&gt;
&lt;br /&gt;
There are a few important properties about sounds:&lt;br /&gt;
*&amp;lt;b&amp;gt;Entity&amp;lt;/b&amp;gt;: The entity the sound should come from.  When playing a generic sound file to player(s), you should use &amp;lt;tt&amp;gt;SOUND_FROM_PLAYER&amp;lt;/tt&amp;gt;, which is a special SourceMod macro for making the sound come from the player target.  For ambient sounds you'd use &amp;lt;tt&amp;gt;SOUND_FROM_WORLD&amp;lt;/tt&amp;gt;, and for sounds from an entity you'd use the entity index.&lt;br /&gt;
*&amp;lt;b&amp;gt;Channel&amp;lt;/b&amp;gt;: Exposed as &amp;lt;tt&amp;gt;SNDCHAN_*&amp;lt;/tt&amp;gt;, normally you only need to use &amp;lt;tt&amp;gt;SNDCHAN_AUTO&amp;lt;/tt&amp;gt;.  The channel affects how the sound is spatialized[?]&lt;br /&gt;
*&amp;lt;b&amp;gt;Level&amp;lt;/b&amp;gt;: The decibel level.  There are a number of predefined levels as &amp;lt;tt&amp;gt;SNDLEVEL_*&amp;lt;/tt&amp;gt; -- the standard one is &amp;lt;tt&amp;gt;SNDLEVEL_NORMAL&amp;lt;/tt&amp;gt;.  Half-Life 1 used attenuation values instead; you can convert from these using &amp;lt;tt&amp;gt;ATTN_TO_SNDLEVEL()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;b&amp;gt;Volume&amp;lt;/b&amp;gt;: The volume, on a scale of 0.0 to 1.0.  To use a volume other than the default, the &amp;lt;tt&amp;gt;SND_CHANGEVOL&amp;lt;/tt&amp;gt; flag should be included in the &amp;quot;flags&amp;quot; parameter.  The default volume is &amp;lt;tt&amp;gt;SNDVOL_NORMAL&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;b&amp;gt;Pitch&amp;lt;/b&amp;gt;: The pitch; predefined values are &amp;lt;tt&amp;gt;SNDPITCH_*&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;SNDPITCH_NORMAL&amp;lt;/tt&amp;gt; being the default.  &amp;lt;tt&amp;gt;SND_CHANGEPITCH&amp;lt;/tt&amp;gt; should be passed to use a non-default pitch.&lt;br /&gt;
*&amp;lt;b&amp;gt;Origin&amp;lt;/b&amp;gt;: If specified, an origin to play the sound from.&lt;br /&gt;
&lt;br /&gt;
Some very simple examples:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
EmitSoundToClient(client, &amp;quot;bot/affirmative.wav&amp;quot;);&lt;br /&gt;
EmitSoundToAll(&amp;quot;radio/terwin.wav&amp;quot;);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Supported Mods=&lt;br /&gt;
SDKTools must have specific support added for each mod.  So far, default support exists for the following modifications:&lt;br /&gt;
*Counter-Strike: Source&lt;br /&gt;
*Day of Defeat: Source&lt;br /&gt;
*Dystopia&lt;br /&gt;
*Half-Life 2: Deathmatch&lt;br /&gt;
*Insurgency (only some of the CBasePlayer SDK functions are available)&lt;br /&gt;
*Pirates, Vikings, and Knights II&lt;br /&gt;
*The Ship&lt;br /&gt;
*SourceForts&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
*[[Vfunc_offsets_%28SourceMM%29|Virtual Functions]]&lt;br /&gt;
*[[TempEnts (SourceMod SDKTools)|TempEnts]]&lt;br /&gt;
*[[Useful_Signatures_%28Source%29|Useful Signatures]]&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Scripting]]&lt;/div&gt;</summary>
		<author><name>ProdigySim</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Talk:Left_4_Dead_2_Events&amp;diff=7762</id>
		<title>Talk:Left 4 Dead 2 Events</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Talk:Left_4_Dead_2_Events&amp;diff=7762"/>
		<updated>2010-07-07T16:23:28Z</updated>

		<summary type="html">&lt;p&gt;ProdigySim: More opinions on organization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Is it ok for me to add more information to the event pages, like when the event is called, what the variables are used for?&lt;br /&gt;
[[User:Oshroth|Oshroth]] 05:09, 19 February 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Of course, if you have more Infos for events then add them&lt;br /&gt;
----&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Is it alright for me to rearrange the events into an easier-to-read list, or at least move the explain_* events to the bottom of the list? Since there is over 70 explain_* events spread throughout the list, making it harder to find the events you are looking for [[User:Oshroth|Oshroth]] 06:42, 20 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
=== Player related events ===&lt;br /&gt;
* player_death&lt;br /&gt;
* player_hurt&lt;br /&gt;
* player_team&lt;br /&gt;
* etc...&lt;br /&gt;
=== Item related events ===&lt;br /&gt;
* item_pickup&lt;br /&gt;
* ammo_pickup&lt;br /&gt;
* grenade_bounce&lt;br /&gt;
* etc...&lt;br /&gt;
=== Achievement related events ===&lt;br /&gt;
* chair_charged&lt;br /&gt;
* song_played&lt;br /&gt;
* foot_locker_opened&lt;br /&gt;
* etc...&lt;br /&gt;
=== Explain (i.e. Game Instructor) related events ===&lt;br /&gt;
* explain_coaster&lt;br /&gt;
* explain_mall_alarm&lt;br /&gt;
* explain_float&lt;br /&gt;
* etc...&lt;br /&gt;
----&lt;br /&gt;
__NOTOC__&lt;br /&gt;
The structure of the events should be the same as in the modevents.res to make it easier for contributors to add and modify events according to the modevents.res if something changes.&lt;br /&gt;
Maybe it's possible to create a new structured menu without modifying the events structure itself.&lt;br /&gt;
:I would support adding a new section for Event Uses or somesuch. Information about when these events are called in relation to in-game happening would be useful. I have some of my own information to add. e.g. item_pickup is called when a player takes control of a SI, including during a tank pass. It would be nice to have this information organized in a way that is more intuitive for people seeking events to hook. --[[User:ProdigySim|ProdigySim]] 16:23, 7 July 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>ProdigySim</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=7734</id>
		<title>Vice keys</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=7734"/>
		<updated>2010-06-03T14:49:22Z</updated>

		<summary type="html">&lt;p&gt;ProdigySim: Added Left4Dead2's VScript .nuc VICE key&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VICE keys are used to encrypt the game's weapon config files in an effort to make them more difficult to tamper with.  It's not really a great protection, as usually the key is just hardcoded into the server binaries.  Some games, such as Golden Eye Source, try to make it more difficult to retrieve these, but even then it's trivial.&lt;br /&gt;
&lt;br /&gt;
These keys can be used to decrypt the CTX files that many games provide.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!width=&amp;quot;300&amp;quot;| Game&lt;br /&gt;
!width=&amp;quot;100&amp;quot;| Key&lt;br /&gt;
|-&lt;br /&gt;
| Counter-Strike: Source&lt;br /&gt;
| d7NSuLq2&lt;br /&gt;
|- &lt;br /&gt;
| CSPromod&lt;br /&gt;
| H1aRQ0n1&lt;br /&gt;
|-&lt;br /&gt;
| Day of Defeat: Source&lt;br /&gt;
| Wl0u5B3F&lt;br /&gt;
|- &lt;br /&gt;
| Dystopia&lt;br /&gt;
| pH3apO8w&lt;br /&gt;
|-&lt;br /&gt;
| Golden Eye Source&lt;br /&gt;
| Gr3naDes&lt;br /&gt;
|- &lt;br /&gt;
| Half-Life 2: Deathmatch&lt;br /&gt;
| x9Ke0BY7&lt;br /&gt;
|- &lt;br /&gt;
| Insurgency&lt;br /&gt;
| DrA5e3EB&lt;br /&gt;
|-&lt;br /&gt;
| Left 4 Dead 2 (VScript .nuc)&lt;br /&gt;
| SDhfi878&lt;br /&gt;
|-&lt;br /&gt;
| TF2 (items.ctx)&lt;br /&gt;
| A5fSXbf7&lt;br /&gt;
|- &lt;br /&gt;
| TF2 (everything else)&lt;br /&gt;
| E2NcUkG2&lt;br /&gt;
|- &lt;br /&gt;
| ZPS&lt;br /&gt;
| 5R0ni0pZ&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>ProdigySim</name></author>
		
	</entry>
</feed>