<?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=Foo+bar</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=Foo+bar"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Foo_bar"/>
	<updated>2026-06-06T14:09:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Entity_References_(SourceMod)&amp;diff=9438</id>
		<title>Entity References (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Entity_References_(SourceMod)&amp;diff=9438"/>
		<updated>2013-12-16T08:34:23Z</updated>

		<summary type="html">&lt;p&gt;Foo bar: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An entity reference is a combination of a standard entity index (used for all entities in SourceMod previously) and a pseudo-unique serial number that identifies the entity. Since entities are constantly being created and destroyed a cached index doesn't guarantee the underlying entity is the same, references provide a way of verifying the same entity still exists. Generally speaking, if you have an entity index you wish to cache you should convert it to a reference first. All natives (provided by SourceMod) should be able to accept references in place of indexes (wherever the parameter asks for an entity - Not clients), and these will use the serial to check that the entity index contained in the reference is the same as when the reference was created.&lt;br /&gt;
&lt;br /&gt;
SourceMod now also supports handling of logical (non-networked entities) and these use references exclusively. Natives that used to return an entity index will continue to do so in the case of networked entities (for backwards compatability) and will only return a reference for non-networked ones.&lt;br /&gt;
&lt;br /&gt;
==Converting a backwards-compat index/ref to a guaranteed reference for safely caching==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
new index = GetEntPropEnt(client, Prop_Send, &amp;quot;m_hActiveWeapon&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
/* Convert our backwards-compat index/ref to a guaranteed reference */&lt;br /&gt;
new ref = EntIndexToEntRef(index);&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Converting a reference back to an entity index==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
new index = EntRefToEntIndex(ref);&lt;br /&gt;
&lt;br /&gt;
if (index == INVALID_ENT_REFERENCE)&lt;br /&gt;
{&lt;br /&gt;
	/* Reference wasn't valid - Entity must have been deleted */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using References to handle a logic entity==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
new ent = -1;  &lt;br /&gt;
   &lt;br /&gt;
while ((ent = FindEntityByClassname(ent, &amp;quot;logic_auto&amp;quot;)) != -1)  &lt;br /&gt;
{  &lt;br /&gt;
    /**   &lt;br /&gt;
     * Get the entity index from this reference - This works on references and indexes for convenience.   &lt;br /&gt;
     * Should be a number &amp;gt;2048 since logic_auto is a non networked entity   &lt;br /&gt;
     */  &lt;br /&gt;
    new ref = EntIndexToEntRef(ent);  &lt;br /&gt;
   &lt;br /&gt;
    /* Fire an input on this entity - We use the reference version since this includes a serial check */  &lt;br /&gt;
    AcceptEntityInput(ref, &amp;quot;Kill&amp;quot;);  &lt;br /&gt;
   &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Scripting]]&lt;/div&gt;</summary>
		<author><name>Foo bar</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=9170</id>
		<title>Vice keys</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=9170"/>
		<updated>2013-11-04T03:30:52Z</updated>

		<summary type="html">&lt;p&gt;Foo bar: &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;
| Contagion&lt;br /&gt;
| fUk0fF69&lt;br /&gt;
|-&lt;br /&gt;
| Counter-Strike: Source / Global Offensive&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 (1.2?)&lt;br /&gt;
| pH3apO8w&lt;br /&gt;
|-&lt;br /&gt;
| Dystopia 1.3 RC2&lt;br /&gt;
| G8stUh3F&lt;br /&gt;
|-&lt;br /&gt;
| Golden Eye Source&lt;br /&gt;
| Gr3naDes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Half-Life 2: Capture the Flag 2.1&lt;br /&gt;
| R1dj3axP&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;
| No More Room In Hell&lt;br /&gt;
| yERrrncN&lt;br /&gt;
|-&lt;br /&gt;
| Nuclear Dawn&lt;br /&gt;
| TA+*veh9&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>Foo bar</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=9169</id>
		<title>Vice keys</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Vice_keys&amp;diff=9169"/>
		<updated>2013-11-04T03:30:41Z</updated>

		<summary type="html">&lt;p&gt;Foo bar: &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;
| Contagion&lt;br /&gt;
| fUk0fF69&lt;br /&gt;
|-&lt;br /&gt;
| Counter-Strike: Source / Global Offensive&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 (1.2?)&lt;br /&gt;
| pH3apO8w&lt;br /&gt;
|-&lt;br /&gt;
| Dystopia 1.3 RC2&lt;br /&gt;
| G8stUh3F&lt;br /&gt;
|-&lt;br /&gt;
| Golden Eye Source&lt;br /&gt;
| Gr3naDes&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Half-Life 2: Capture the Flag&lt;br /&gt;
| R1dj3axP&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;
| No More Room In Hell&lt;br /&gt;
| yERrrncN&lt;br /&gt;
|-&lt;br /&gt;
| Nuclear Dawn&lt;br /&gt;
| TA+*veh9&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>Foo bar</name></author>
		
	</entry>
</feed>