<?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=Vittu</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=Vittu"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Vittu"/>
	<updated>2026-06-02T00:05:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7041</id>
		<title>SuperHero Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7041"/>
		<updated>2009-03-26T06:32:53Z</updated>

		<summary type="html">&lt;p&gt;Vittu: added very little content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''''SuperHero Mod (SH Mod)''''' is a [http://en.wikipedia.org/wiki/Counter-Strike Counter-Strike] / [http://en.wikipedia.org/wiki/Counter-Strike:_Condition_Zero Counter-Strike: Condition Zero] [[AMX Mod X]] plugin. It was originally created by {Hoj}Batman for AMX Mod to be an extendable plugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;What if SuperHeroes Played Counter-Strike?&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now they Do. This is an add-on that will make Mix/Match Hero Abilities available to players. Pick and choose hero powers as you advance levels from a vast selection of heroes.&amp;lt;br&amp;gt;&lt;br /&gt;
Thanks goes out to {Hoj}Batman for this awesome plugin, he is the original author that got it all started and did most of (if not all) of the original coding.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ToDo: Fill this in&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://shero.alliedmods.net/ SuperHero Mod website] - Official website&lt;br /&gt;
**[http://forums.alliedmods.net/forumdisplay.php?f=30 SuperHero Mod forums] - Official forums&lt;br /&gt;
*[http://svn.tcwonline.org/viewvc.cgi/?root=superhero SuperHero Mod SVN] - SVN for latest build&lt;br /&gt;
*[http://fs.alliedmods.net/index.php?project=7 SuperHero Mod Bug Reports] - Report bugs with SuperHero Mod&lt;br /&gt;
*[http://steamcommunity.com/groups/shero SuperHero Mod (SH Mod)] - Official Steam Community&lt;br /&gt;
&lt;br /&gt;
[[Category:3rd Party Plugins (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7040</id>
		<title>SuperHero Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7040"/>
		<updated>2009-03-26T05:53:41Z</updated>

		<summary type="html">&lt;p&gt;Vittu: added more content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;u&amp;gt;What if SuperHeroes Played Counter-Strike?&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Now they Do. This is an add-on that will make Mix/Match Hero Abilities available to players. Pick and choose hero powers as you advance levels from a vast selection of heroes.&amp;lt;br&amp;gt;&lt;br /&gt;
Thanks goes out to {Hoj}Batman for this awesome plugin, he is the original author that got it all started and did most of (if not all) of the original coding.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ToDo: Fill this in&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://shero.alliedmods.net/ SuperHero Mod website] - Official website&lt;br /&gt;
**[http://forums.alliedmods.net/forumdisplay.php?f=30 SuperHero Mod forums] - Official forums&lt;br /&gt;
*[http://svn.tcwonline.org/viewvc.cgi/?root=superhero SuperHero Mod SVN] - SVN for latest build&lt;br /&gt;
*[http://fs.alliedmods.net/index.php?project=7 SuperHero Mod Bug Reports] - Report bugs with SuperHero Mod&lt;br /&gt;
*[http://steamcommunity.com/groups/shero SuperHero Mod (SH Mod)] - Official Steam Community&lt;br /&gt;
&lt;br /&gt;
[[Category:3rd Party Plugins (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7039</id>
		<title>SuperHero Mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SuperHero_Mod&amp;diff=7039"/>
		<updated>2009-03-26T04:22:07Z</updated>

		<summary type="html">&lt;p&gt;Vittu: Created page for SuperHero Mod documenation.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Place holder for adding documentation.&lt;br /&gt;
&lt;br /&gt;
[[Category:3rd Party Plugins (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Writing_Extensions_from_Metamod:Source_Plugins&amp;diff=5340</id>
		<title>Writing Extensions from Metamod:Source Plugins</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Writing_Extensions_from_Metamod:Source_Plugins&amp;diff=5340"/>
		<updated>2007-11-13T21:23:49Z</updated>

		<summary type="html">&lt;p&gt;Vittu: /* Doing Something Useful */  fixed Writing Extensions link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[SourceMod]]'s &amp;quot;External Extensions&amp;quot; feature lets developers implement an extension simply by passing in an object instance, rather than implementing a full library file.  This is typically done from [[Metamod:Source]] plugins which wish to:&lt;br /&gt;
&lt;br /&gt;
*Enable optional, third party extensibility via SourceMod's scripting layer.&lt;br /&gt;
*For whatever reason, do not want to move their &amp;quot;standalone&amp;quot; plugin to a full SourceMod extension.&lt;br /&gt;
*Or any of the above, in the presence of SourceMod, without actually requiring it to be loaded.&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
Attaching to SourceMod will be fairly easy for any developer who has authored a Metamod:Source plugin.  However, unlike Metamod:Source, SourceMod has fairly stricter design standards and a much richer API set.  It is unacceptable to not account for details such as unloading, and special attention must be taken care to free and manage SourceMod resources properly.  Remember crashes or Handle leaks will affect all of SourceMod's loaded plugins/extensions, instead of just your plugin.&lt;br /&gt;
&lt;br /&gt;
The general steps are:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Implement the &amp;lt;tt&amp;gt;IExtensionInterface&amp;lt;/tt&amp;gt; interface, from &amp;lt;tt&amp;gt;public/IExtensionSys.h&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;In &amp;lt;tt&amp;gt;ISmmPlugin::AllPluginsLoaded()&amp;lt;/tt&amp;gt;, perform the attach if possible.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Detect SourceMod loads in &amp;lt;tt&amp;gt;IMetamodListener::OnMetamodQuery()&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Store global pointers once bound, such as the self-referencing &amp;lt;tt&amp;gt;IExtension *&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;On &amp;lt;tt&amp;gt;ISmmPlugin::Unload()&amp;lt;/tt&amp;gt;, detach from SourceMod.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that SourceMod requires each extension to have a unique name.  This is not necessarily a file name, although usually it resembles one.  This name is to used, in conjunction with include files, to make sure plugin requirements are met when they load.&lt;br /&gt;
&lt;br /&gt;
=Detailed Steps=&lt;br /&gt;
The information below is for a more detailed overview.  The sample SDK provides a full implementation that is recommended over simply copying and pasting the sample code provided here.  The sample SDK is explained further on.&lt;br /&gt;
&lt;br /&gt;
==Implementing the Extension==&lt;br /&gt;
Implementing the actual Extension itself means simply inheriting the &amp;lt;tt&amp;gt;IExtensionInterface&amp;lt;/tt&amp;gt; class as noted earlier.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
class MyExtension : public IExtensionInterface&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    virtual bool OnExtensionLoad(IExtension *me,&lt;br /&gt;
        IShareSys *sys,&lt;br /&gt;
        char *error,&lt;br /&gt;
        size_t maxlength,&lt;br /&gt;
        bool late);&lt;br /&gt;
    virtual void OnExtensionUnload();&lt;br /&gt;
    virtual void OnExtensionsAllLoaded();&lt;br /&gt;
    virtual void OnExtensionPauseChange(bool pause);&lt;br /&gt;
    virtual bool QueryRunning(char *error, size_t maxlength);&lt;br /&gt;
    virtual bool IsMetamodExtension();&lt;br /&gt;
    virtual const char *GetExtensionName();&lt;br /&gt;
    virtual const char *GetExtensionURL();&lt;br /&gt;
    virtual const char *GetExtensionTag();&lt;br /&gt;
    virtual const char *GetExtensionAuthor();&lt;br /&gt;
    virtual const char *GetExtensionVerString();&lt;br /&gt;
    virtual const char *GetExtensionDescription();&lt;br /&gt;
    virtual const char *GetExtensionDateString();&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most functions are self explanatory.  A few important notes:&lt;br /&gt;
*&amp;lt;tt&amp;gt;OnExtensionLoad&amp;lt;/tt&amp;gt; is used to provide essential interfaces: &amp;lt;tt&amp;gt;IShareSys&amp;lt;/tt&amp;gt; (acquires/shares objects in the SourceMod heirarchy), and &amp;lt;tt&amp;gt;IExtension&amp;lt;/tt&amp;gt; (self-referencing pointer used for identification and unloading).&lt;br /&gt;
*&amp;lt;tt&amp;gt;OnExtensionLoad&amp;lt;/tt&amp;gt; is also used to query for any extra interfaces that the extension requires.  For example, if the [[Handle API (SourceMod)|Handle System]] is needed, it would be queried and its pointer cached.  If it couldn't be found, then &amp;lt;tt&amp;gt;OnExtensionLoad&amp;lt;/tt&amp;gt; would return false to deny loading.&lt;br /&gt;
*&amp;lt;tt&amp;gt;OnExtensionUnload()&amp;lt;/tt&amp;gt; is used to free resources.  If a resource (interface) is being used from another extension, and that extension is unloaded, separate cases must be taken care of because of dynamic unloadability.  These (unusual) cases are explained further in the [[Writing Extensions]] article.&lt;br /&gt;
*&amp;lt;tt&amp;gt;IsMetamodExtension()&amp;lt;/tt&amp;gt; must return false.  No exceptions.  Only pure-SourceMod extensions which optionally bind to Metamod:Source can return true here.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
IShareSys *sharesys = NULL;&lt;br /&gt;
IExtension *myself = NULL;&lt;br /&gt;
&lt;br /&gt;
bool MyExtension::OnExtensionLoad(IExtension *me,&lt;br /&gt;
        IShareSys *sys,&lt;br /&gt;
        char *error,&lt;br /&gt;
        size_t maxlength,&lt;br /&gt;
        bool late)&lt;br /&gt;
{&lt;br /&gt;
    sharesys = sys;&lt;br /&gt;
    myself = me;&lt;br /&gt;
&lt;br /&gt;
    /* Get anything important we rely on */&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Binding to SourceMod==&lt;br /&gt;
Binding to SourceMod requires a few steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Acquire the &amp;lt;tt&amp;gt;IExtensionManager&amp;lt;/tt&amp;gt; interface.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If it exists, bind the extension.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If not, wait for SourceMod to load.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;IExtensionSys.h&amp;lt;/tt&amp;gt; provides a macro, &amp;lt;tt&amp;gt;SOURCEMOD_INTERFACE_EXTENSIONSYS&amp;lt;/tt&amp;gt;, which can be used via &amp;lt;tt&amp;gt;ISmmAPI::MetamodQuery()&amp;lt;/tt&amp;gt;.  If you do not recall, that is the facility Metamod:Source uses for inter-plugin communication.  An example implementation of binding to SourceMod might look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
bool SM_LoadExtension(char *error, size_t maxlength)&lt;br /&gt;
{&lt;br /&gt;
    if ((smexts = (IExtensionManager *)g_SMAPI-&amp;gt;MetaFactory(&lt;br /&gt;
            SOURCEMOD_INTERFACE_EXTENSIONS,&lt;br /&gt;
            NULL,&lt;br /&gt;
            NULL)) == NULL)&lt;br /&gt;
    {&lt;br /&gt;
        UTIL_Format(error, maxlength, SOURCEMOD_INTERFACE_EXTENSIONS &amp;quot; interface not found&amp;quot;);&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    char path[256];&lt;br /&gt;
    g_SMAPI-&amp;gt;PathFormat(path, sizeof(path),&lt;br /&gt;
#if defined __linux__&lt;br /&gt;
        &amp;quot;addons/myplugin/bin/myplugin_mm_i486.so&amp;quot;&lt;br /&gt;
#else&lt;br /&gt;
        &amp;quot;addons\\myplugin\\bin\\myplugin_mm.dll&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    if ((myself = smexts-&amp;gt;LoadExternal(&amp;amp;g_SMExt,&lt;br /&gt;
            path,&lt;br /&gt;
            &amp;quot;myplugin_mm.ext&amp;quot;,&lt;br /&gt;
            error,&lt;br /&gt;
            maxlength)) == NULL)&lt;br /&gt;
    {&lt;br /&gt;
        /* Error was supplied by call */&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Detecting SourceMod Loads==&lt;br /&gt;
This is also fairly easy:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If not already done: Inherit &amp;lt;tt&amp;gt;IMetamodListener&amp;lt;/tt&amp;gt;, implement &amp;lt;tt&amp;gt;OnMetamodQuery()&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;If not already done: Call &amp;lt;tt&amp;gt;ISmmAPI::AddListener&amp;lt;/tt&amp;gt; for your &amp;lt;tt&amp;gt;IMetamodListener&amp;lt;/tt&amp;gt; interface.&amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt;Watch for occurrences of &amp;lt;tt&amp;gt;SOURCEMOD_NOTICE_EXTENSIONS&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of such an implementation:&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late)&lt;br /&gt;
{&lt;br /&gt;
    PLUGIN_SAVEVARS();&lt;br /&gt;
&lt;br /&gt;
    /* Blah blah blah */    &lt;br /&gt;
&lt;br /&gt;
    ismm-&amp;gt;AddListener(this, this);&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void StubPlugin::AllPluginsLoaded()&lt;br /&gt;
{&lt;br /&gt;
    /* BIND TO SOURCMEOD IF POSSIBLE */&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void *StubPlugin::OnMetamodQuery(const char *iface, int *ret)&lt;br /&gt;
{&lt;br /&gt;
    if (strcmp(iface, SOURCEMOD_NOTICE_EXTENSIONS) == 0)&lt;br /&gt;
    {&lt;br /&gt;
        /* BIND TO SOURCEMOD */&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (ret != NULL)&lt;br /&gt;
    {&lt;br /&gt;
        *ret = IFACE_OK;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return NULL;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is very important to return &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; even when this interface is detected.  Otherwise, you may block other extensions from receiving the callback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detaching from SourceMod==&lt;br /&gt;
Detaching is essential; if your plugin unloads without detaching, SourceMod will very quickly crash trying to deference your memory.  Luckily, doing so is trivial.  For example, in your &amp;lt;tt&amp;gt;ISmmPlugin::Unload()&amp;lt;/tt&amp;gt; callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
bool StubPlugin::Unload(char *error, size_t maxlen)&lt;br /&gt;
{&lt;br /&gt;
    smexts-&amp;gt;UnloadExtension(myself);&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;tt&amp;gt;smexts&amp;lt;/tt&amp;gt; is the &amp;lt;tt&amp;gt;IExtensionManager&amp;lt;/tt&amp;gt; pointer, and &amp;lt;tt&amp;gt;myself&amp;lt;/tt&amp;gt; is the &amp;lt;tt&amp;gt;IExtension&amp;lt;/tt&amp;gt; pointer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=SDK and Sample Implementation=&lt;br /&gt;
The SourceMod SDK contains a sample implementation in &amp;lt;tt&amp;gt;public/mms_sample_ext&amp;lt;/tt&amp;gt;.  It is the Metamod:Source &amp;quot;stub plugin,&amp;quot; modified to load as a SourceMod extension.&lt;br /&gt;
&lt;br /&gt;
The following files have been added:&lt;br /&gt;
*&amp;lt;tt&amp;gt;sm_sdk_config.h&amp;lt;/tt&amp;gt; - Contains two function for mapping and unmapping SourceMod Core interfaces.  Interfaces can be enabled or disabled by toggling comments next to preprocessor macros here.&lt;br /&gt;
*&amp;lt;tt&amp;gt;sm_sdk_config.cpp&amp;lt;/tt&amp;gt; - Implementation of &amp;lt;tt&amp;gt;sm_sdk_config.h&amp;lt;/tt&amp;gt;.  There is no need to edit this.&lt;br /&gt;
*&amp;lt;tt&amp;gt;stub_util.h/cpp&amp;lt;/tt&amp;gt; - Contains a platform-safe wrapper for text formatting.&lt;br /&gt;
*&amp;lt;tt&amp;gt;sm_ext.cpp/sm_ext.h&amp;lt;/tt&amp;gt; - Sample implementation &amp;lt;tt&amp;gt;IExtensionInterface.h&amp;lt;/tt&amp;gt; and the binding/detaching code.&lt;br /&gt;
&lt;br /&gt;
Additionally, &amp;lt;tt&amp;gt;stub_mm.cpp&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;stub_mm.h&amp;lt;/tt&amp;gt; have been modified.  &amp;lt;tt&amp;gt;IMetamodListener&amp;lt;/tt&amp;gt; is inherited, and &amp;lt;tt&amp;gt;OnMetamodQuery&amp;lt;/tt&amp;gt; is implemented as described earlier.  Also, &amp;lt;tt&amp;gt;ISmmAPI::AllPluginsLoaded&amp;lt;/tt&amp;gt; attempts a SourceMod binding.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' &amp;lt;tt&amp;gt;sm_sdk_config.h&amp;lt;/tt&amp;gt; provides &amp;lt;tt&amp;gt;SM_AcquireInterfaces&amp;lt;/tt&amp;gt;.  It must be called to acquire the interfaces that are uncommented in the same file, unless you intend to query them manually.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' It is highly recommend that developers read the added files, and at the very least, include the &amp;lt;tt&amp;gt;sm_sdk_config&amp;lt;/tt&amp;gt; files, which greatly simplify the acquisition of interfaces.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The Makefiles are provided as a convenience/example, and for our own testing.  As our build process requires special vcproj/sln changes (which are not yet documented), no Visual Studio project files are provided for &amp;lt;tt&amp;gt;mms_sample_ext&amp;lt;/tt&amp;gt;.  As most developers will already have an MM:S plugin implemented, this should largely be irrelevant.  Otherwise, the project files from &amp;lt;tt&amp;gt;stub_mm&amp;lt;/tt&amp;gt; can be used instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Renamed Variables/Macros==&lt;br /&gt;
The extension SDK has a few renamed macros/variables from the default SDK.  This is to prevent potential name clashes for Metamod:Source plugins, which have pre-existing code.&lt;br /&gt;
&lt;br /&gt;
'''Changed global variables:'''&lt;br /&gt;
*g_pForwards, forwards -&amp;gt; sm_forwards&lt;br /&gt;
*g_pHandleSys, handlesys -&amp;gt; sm_handlesys&lt;br /&gt;
*g_pSM -&amp;gt; sm_main&lt;br /&gt;
*playerhelpers -&amp;gt; sm_players&lt;br /&gt;
*dbi -&amp;gt; sm_dbi&lt;br /&gt;
*gameconfs -&amp;gt; sm_gameconfs&lt;br /&gt;
*memutils -&amp;gt; sm_memutils&lt;br /&gt;
*gamehelpers -&amp;gt; sm_gamehelpers&lt;br /&gt;
*timersys -&amp;gt; sm_timersys&lt;br /&gt;
*threader -&amp;gt; sm_threader&lt;br /&gt;
*libsys -&amp;gt; sm_libsys&lt;br /&gt;
*plsys -&amp;gt; sm_plsys&lt;br /&gt;
*textparsers -&amp;gt; sm_text&lt;br /&gt;
*adminsys -&amp;gt; sm_adminsys&lt;br /&gt;
*menus -&amp;gt; sm_menus&lt;br /&gt;
&lt;br /&gt;
'''Changed macros:'''&lt;br /&gt;
*&amp;lt;tt&amp;gt;SM_GET_IFACE&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;SM_FIND_IFACE_OR_FAIL&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SM_GET_LATE_IFACE&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;SM_FIND_IFACE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Example of a Successful Load==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
meta load addons/stub_mm&lt;br /&gt;
Plugin &amp;quot;Stub Plugin&amp;quot; loaded with id 3.&lt;br /&gt;
sm exts list&lt;br /&gt;
[SM] Displaying 3 extensions:&lt;br /&gt;
[01] SDK Tools (1.0.0.1336): Source SDK Tools&lt;br /&gt;
[02] BinTools (1.0.0.1336): Low-level C/C++ Calling API&lt;br /&gt;
[03] Stub Plugin (1.0.0.0): Sample empty plugin&lt;br /&gt;
sm exts info 3&lt;br /&gt;
 File: myplugin_mm.ext&lt;br /&gt;
 Loaded: Yes (version 1.0.0.0)&lt;br /&gt;
 Name: Stub Plugin (Sample empty plugin)&lt;br /&gt;
 Author: AlliedModders LLC (http://www.sourcemm.net/)&lt;br /&gt;
 Binary info: API version 2 (compiled Nov 10 2007)&lt;br /&gt;
 Method: Loaded by Metamod:Source, attached to SourceMod&lt;br /&gt;
meta unload 3&lt;br /&gt;
Plugin 3 unloaded.&lt;br /&gt;
sm exts list&lt;br /&gt;
[SM] Displaying 2 extensions:&lt;br /&gt;
[01] SDK Tools (1.0.0.1336): Source SDK Tools&lt;br /&gt;
[02] BinTools (1.0.0.1336): Low-level C/C++ Calling API&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Doing Something Useful=&lt;br /&gt;
SourceMod has over a dozen interfaces for interacting with plugins and greatly simplifying the Half-Life 2 development process.  It contains memory abstraction, fast data structures, an abstracted menu and voting system, the ability to create and invoke plugin callbacks (&amp;quot;forwards&amp;quot;), the ability to provide new native functions to plugins, text processing, game data abstraction, threading abstraction, signature scanning, timers, and an object-oriented SQL layer.&lt;br /&gt;
&lt;br /&gt;
For more information, see the [[Writing Extensions]] article.  Note that the article uses different global names.  See the earlier section for finding which names changed.&lt;br /&gt;
&lt;br /&gt;
=Further Reading=&lt;br /&gt;
*[[Writing Extensions]]&lt;br /&gt;
*[[:Category:SourceMod Development|SourceMod Development Category]]&lt;br /&gt;
*[http://www.sourcemod.net/sdk/dox/ C++ API auto-generated documentation]&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Development]].&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Adding_Admins_(AMX_Mod_X)&amp;diff=3191</id>
		<title>Adding Admins (AMX Mod X)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Adding_Admins_(AMX_Mod_X)&amp;diff=3191"/>
		<updated>2006-07-26T07:48:18Z</updated>

		<summary type="html">&lt;p&gt;Vittu: Small fix plus format changes to links in page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Admins (non-SQL)=&lt;br /&gt;
==Adding an Admin==&lt;br /&gt;
First, open the amxmodx/configs/users.ini file with your favorite text editor.  Scroll to the bottom.  Admin entries are stored with four options: Authentication, Password, Access Right, Connection Properties.&lt;br /&gt;
&lt;br /&gt;
In the early days of [[Half-Life 1]] it was common to have admins authenticate by name.  However, now it is recommended to auth by steamid.  An example of a typical admin entry is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;STEAM_0:0:123456&amp;quot; &amp;quot;&amp;quot; &amp;quot;abcdefghijklmnopqrstu&amp;quot; &amp;quot;ce&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Entries are one-per-line, and each of the four options are space separated, contained in double-quotes.  This one means:&lt;br /&gt;
#The user has [[SteamID]] STEAM_0:0:123456&lt;br /&gt;
#The user has no password (steamid-authentication)&lt;br /&gt;
#Access rights are levels &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; through &amp;lt;tt&amp;gt;u&amp;lt;/tt&amp;gt;&lt;br /&gt;
#The user is a steamid (&amp;quot;c&amp;quot;) and has no password (&amp;quot;e&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
It is also possible to authenticate by username:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;BAILOPAN&amp;quot; &amp;quot;mypass&amp;quot; &amp;quot;abcdefghijklmnopqrstu&amp;quot; &amp;quot;a&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To authenticate, BAILOPAN would put this in his client's autoexec.cfg, where &amp;quot;_pw&amp;quot; is the value of &amp;quot;amx_password_field&amp;quot; in [[amxx.cfg]].&lt;br /&gt;
&amp;lt;pre&amp;gt;setinfo &amp;quot;_pw&amp;quot; &amp;quot;mypass&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For information on what access levels mean, see [[#Access Levels|Access Levels]].&lt;br /&gt;
&lt;br /&gt;
{{qnotice|It is important that you do not use the 'z' flag for admins.}}&lt;br /&gt;
&lt;br /&gt;
==Removing an Admin==&lt;br /&gt;
Find the admin's entry in your amxmodx/configs/users.ini file, and put a semicolon in front of it.  For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;;&amp;quot;STEAM_0:0:123456&amp;quot; &amp;quot;&amp;quot; &amp;quot;abcdefghijklmnopqrstu&amp;quot; &amp;quot;ce&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That will prevent the entry from being read.&lt;br /&gt;
{{LanguageSwitch}}&lt;br /&gt;
&lt;br /&gt;
=Admins (SQL)=&lt;br /&gt;
AMX Mod X lets you store admin accounts in a MySQL database.  This is ideal if you have multiple servers with common administrators.&lt;br /&gt;
&lt;br /&gt;
==Configuring Server==&lt;br /&gt;
First, make sure you have configured your server for SQL by reading [[Configuring AMX Mod X#SQL|Configuring AMX Mod X: SQL]].  Then, enable the admin_sql.amxx plugin instead of admin.amxx, by opening amxmodx/configs/plugins.ini.  You should change the first two entries to look something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;;admin.amxx ; Disabled &lt;br /&gt;
admin_sql.amxx ; SQL admins&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Maintaining Admins==&lt;br /&gt;
&lt;br /&gt;
Once the server loads for the first time, it will automatically create the table specified with &amp;lt;tt&amp;gt;amx_sql_table&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can either add an admin through an SQL tool like an SQL Console or phpMyAdmin, or you can add an admin [[Adding Admins (AMX Mod X)#Console Command|using amx_addadmin]].  &lt;br /&gt;
&lt;br /&gt;
If you choose to use SQL directly (or an interface), you must learn the table layout.  There are four columns, each corresponding to one of the four properties listed above in [[#Adding an Admin|Adding an Admin]].  For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;INSERT INTO admins VALUES(&amp;quot;STEAM_0:1:23456&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;abcdefghijklmnopqrstu&amp;quot;, &amp;quot;ce&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{qnotice|It is important that you do not use the 'z' flag for admins.}}&lt;br /&gt;
&lt;br /&gt;
For information on what access levels mean, see [[AMX Mod X Access Levels]].&lt;br /&gt;
{{LanguageSwitch}}&lt;br /&gt;
&lt;br /&gt;
=Console Command=&lt;br /&gt;
&lt;br /&gt;
You can also use the console command amx_addadmin for adding admins.  It will work for both [[SQL]] and users.ini, depending on which plugin you have enabled.  An example of using the command in-game:&lt;br /&gt;
&amp;lt;pre&amp;gt;amx_addadmin &amp;quot;BAILOPAN&amp;quot; &amp;quot;abcdefghijklmnopqrstu&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Using the command from the server/[[rcon]] console:&lt;br /&gt;
&amp;lt;pre&amp;gt;amx_addadmin &amp;quot;STEAM_0:1:23456&amp;quot; &amp;quot;abcdefgihjklmnopqrstu&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Access Levels=&lt;br /&gt;
These access levels are the default access levels for the base [[AMX Mod X]] plugins.  3rd party plugins may have different usages for them, although in general users try to stick to the intentions for each flag.&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Access Flag&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| a&lt;br /&gt;
| immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| b&lt;br /&gt;
| reservation (can join on reserved slots)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| c &lt;br /&gt;
| amx_kick command&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| d &lt;br /&gt;
| amx_ban and amx_unban commands&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| e &lt;br /&gt;
| amx_slay and amx_slap commands&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| f&lt;br /&gt;
| amx_map command&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| g&lt;br /&gt;
| amx_cvar command (not all cvars will be available)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| h&lt;br /&gt;
| amx_cfg command&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| i&lt;br /&gt;
| amx_chat and other chat commands&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| j&lt;br /&gt;
| amx_vote and other vote commands&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| k&lt;br /&gt;
| access to sv_password cvar (by amx_cvar command)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| l&lt;br /&gt;
| access to amx_rcon command and rcon_password cvar (by amx_cvar command)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| m&lt;br /&gt;
| custom level A (for additional plugins)&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| n&lt;br /&gt;
| custom level B&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| o&lt;br /&gt;
| custom level C&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| p&lt;br /&gt;
| custom level D&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| q&lt;br /&gt;
| custom level E&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| r&lt;br /&gt;
| custom level F&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| s&lt;br /&gt;
| custom level G&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| t&lt;br /&gt;
| custom level H&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| u&lt;br /&gt;
| menu access&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| z&lt;br /&gt;
| user (no admin)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Connection Flags=&lt;br /&gt;
These flags control how [[AMX Mod X]] attempts to authorize a connecting admin.&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Connection Flag&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| a &lt;br /&gt;
| disconnect player on invalid password&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| b&lt;br /&gt;
| clan tag&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| c&lt;br /&gt;
| this is steamid/wonid&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| d&lt;br /&gt;
| this is ip&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| e&lt;br /&gt;
| password is not checked (only name/ip/steamid needed)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2550</id>
		<title>Temp Entity Events (Half-Life 1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2550"/>
		<updated>2006-02-05T00:45:43Z</updated>

		<summary type="html">&lt;p&gt;Vittu: Added more effects, plus slight change to format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add Main Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Message Types=&lt;br /&gt;
Sets the type of message the temp entity is transmitted in.&lt;br /&gt;
&lt;br /&gt;
MSG_ types that can be used for ''dest'' field in [http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=262 message_begin] are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;#define MSG_BROADCAST		0	// unreliable to all&lt;br /&gt;
#define MSG_ONE			1	// reliable to one (msg_entity)&lt;br /&gt;
#define MSG_ALL			2	// reliable to all&lt;br /&gt;
#define MSG_INIT		3	// write to the init string&lt;br /&gt;
#define MSG_PVS			4	// Ents in PVS of org&lt;br /&gt;
#define MSG_PAS			5	// Ents in PAS of org&lt;br /&gt;
#define MSG_PVS_R		6	// Reliable to PVS&lt;br /&gt;
#define MSG_PAS_R		7	// Reliable to PAS&lt;br /&gt;
#define MSG_ONE_UNRELIABLE	8	// Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)&lt;br /&gt;
#define MSG_SPEC		9	// Sends to all spectator proxies&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= TempEnt Events =&lt;br /&gt;
Add Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 0: TE_BEAMPOINTS ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a beam between two points.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Starting point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RBG triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMPOINTS 0		// beam effect between two points&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_BEAMPOINTS)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()	// end position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// starting frame&lt;br /&gt;
write_byte()	// frame rate in 0.1's&lt;br /&gt;
write_byte()	// life in 0.1's&lt;br /&gt;
write_byte()	// line width in 0.1's&lt;br /&gt;
write_byte()	// noise amplitude in 0.01's&lt;br /&gt;
write_byte()	// Red&lt;br /&gt;
write_byte()	// Green&lt;br /&gt;
write_byte()	// Blue&lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1: TE_BEAMENTPOINT ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a beam between the primary entity and a point.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| ID of Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Primary entity id&lt;br /&gt;
|Starting point of the beam from the id's origin&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RBG triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMENTPOINT 1	// beam effect between point and entity&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_BEAMENTPOINT)&lt;br /&gt;
write_short()	// start entity&lt;br /&gt;
write_coord()	// end position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// starting frame&lt;br /&gt;
write_byte()	// frame rate in 0.1's&lt;br /&gt;
write_byte()	// life in 0.1's&lt;br /&gt;
write_byte()	// line width in 0.1's&lt;br /&gt;
write_byte()	// noise amplitude in 0.01's&lt;br /&gt;
write_byte()	// Red&lt;br /&gt;
write_byte()	// Green&lt;br /&gt;
write_byte()	// Blue&lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2: TE_GUNSHOT ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a particle effect plus a ricochet sound.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the gunshot effect&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_GUNSHOT 2		// particle effect plus ricochet sound&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_GUNSHOT)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 3: TE_EXPLOSION ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates an additive sprite, 2 dynamic lights, flickering particles, explosion sound, and moves the sprite vertically.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the explosion effect&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/zerogxplode.spr&amp;quot;&lt;br /&gt;
|The additive sprite to use in the explosion&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scale&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 1&lt;br /&gt;
|The scale of the sprite in the explosion, in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Flags&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-15&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|Sets flags for the explosion, you may also add these together:&lt;br /&gt;
*0: Default Half-Life explosion&lt;br /&gt;
*1: Sprite will be drawn opaque&lt;br /&gt;
*2: Do not render the dynamic lights&lt;br /&gt;
*4: Do not play the explosion sound&lt;br /&gt;
*8: Do not draw the particles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_EXPLOSION 3		// additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_EXPLOSION)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// scale in 0.1's&lt;br /&gt;
write_byte()	// framerate&lt;br /&gt;
write_byte()	// flags&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4: TE_TAREXPLOSION ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates the Quake 'tar' explosion.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the effect&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_TAREXPLOSION 4	// Quake1 &amp;quot;tarbaby&amp;quot; explosion with sound&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_TAREXPLOSION)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5: TE_SMOKE ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a rising alphablend sprite at 30 pps.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the smoke effect&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/steam1.spr&amp;quot;&lt;br /&gt;
|The alphablend sprite to use for smoke&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scale&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 1&lt;br /&gt;
|The scale of the smoke, in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_SMOKE 5			// alphablend sprite, move vertically 30 pps&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_SMOKE)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index &lt;br /&gt;
write_byte()	// scale in 0.1's &lt;br /&gt;
write_byte()	// framerate &lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 6: TE_TRACER ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a tracer effect from one point to another.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Starting point of the tracer&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the tracer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_TRACER 6			// tracer effect from point to point&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_TRACER)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()	// end position &lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 7: TE_LIGHTNING ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Simplified options for TE_BEAMPOINTS - Lightning effect.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Starting point of the lightning&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the lightning&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the lightning shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the lightning in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the lightning, this controls how much it distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the lightning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_LIGHTNING 7		// TE_BEAMPOINTS with simplified parameters&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_LIGHTNING)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()	// end position &lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_byte()	// life in 0.1's &lt;br /&gt;
write_byte()	// width in 0.1's &lt;br /&gt;
write_byte()	// amplitude in 0.01's &lt;br /&gt;
write_short()	// sprite model index&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 8: TE_BEAMENTS ==&lt;br /&gt;
&amp;lt;font size=3&amp;gt;Creates a beam between the primary entity and another entity.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Options&amp;lt;/font&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| ID of Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Primary entity id&lt;br /&gt;
|Starting point of the beam from the id's origin&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| ID of Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Secondary entity id&lt;br /&gt;
|Ending point of the beam to the id's origin&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RBG triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font size=4&amp;gt;Format&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMENTS 8		// Create a beam between two entities&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)&lt;br /&gt;
write_byte(TE_BEAMENTS)&lt;br /&gt;
write_short()	// start entity&lt;br /&gt;
write_short()  // end entity&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// starting frame&lt;br /&gt;
write_byte()	// frame rate in 0.1's&lt;br /&gt;
write_byte()	// life in 0.1's&lt;br /&gt;
write_byte()	// line width in 0.1's&lt;br /&gt;
write_byte()	// noise amplitude in 0.01's&lt;br /&gt;
write_byte()	// red&lt;br /&gt;
write_byte()	// green&lt;br /&gt;
write_byte()	// blue&lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: add rest, I'll get this done eventually. &lt;br /&gt;
[[Category:Half-Life 1]]&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2545</id>
		<title>Temp Entity Events (Half-Life 1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2545"/>
		<updated>2006-02-02T04:55:42Z</updated>

		<summary type="html">&lt;p&gt;Vittu: Added more TE messages (will cont. later)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add Main Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Message Types=&lt;br /&gt;
Sets the type of message the temp entity is transmitted in.&lt;br /&gt;
&lt;br /&gt;
MSG_ types that can be used for ''dest'' field in [http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=262 message_begin] are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;#define MSG_BROADCAST		0	// unreliable to all&lt;br /&gt;
#define MSG_ONE			1	// reliable to one (msg_entity)&lt;br /&gt;
#define MSG_ALL			2	// reliable to all&lt;br /&gt;
#define MSG_INIT		3	// write to the init string&lt;br /&gt;
#define MSG_PVS			4	// Ents in PVS of org&lt;br /&gt;
#define MSG_PAS			5	// Ents in PAS of org&lt;br /&gt;
#define MSG_PVS_R		6	// Reliable to PVS&lt;br /&gt;
#define MSG_PAS_R		7	// Reliable to PAS&lt;br /&gt;
#define MSG_ONE_UNRELIABLE	8	// Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)&lt;br /&gt;
#define MSG_SPEC		9	// Sends to all spectator proxies&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= TempEnt Events =&lt;br /&gt;
Add Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 0: TE_BEAMPOINTS ==&lt;br /&gt;
Creates a beam between two points.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Starting point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RGB triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMPOINTS 0			// beam effect between two points&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_BEAMPOINTS)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()	// end position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// starting frame&lt;br /&gt;
write_byte()	// frame rate in 0.1's&lt;br /&gt;
write_byte()	// life in 0.1's&lt;br /&gt;
write_byte()	// line width in 0.1's&lt;br /&gt;
write_byte()	// noise amplitude in 0.01's&lt;br /&gt;
write_byte()	// Red&lt;br /&gt;
write_byte()	// Green&lt;br /&gt;
write_byte()	// Blue&lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1: TE_BEAMENTPOINT ==&lt;br /&gt;
Creates a beam between the primary entity and a point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| ID of Entity&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Primary entity id&lt;br /&gt;
|Starting point of the beam from the id's origin&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RGB triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMENTPOINT 1		// beam effect between point and entity&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_BEAMENTPOINT)&lt;br /&gt;
write_short()	// start entity&lt;br /&gt;
write_coord()	// end position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// starting frame&lt;br /&gt;
write_byte()	// frame rate in 0.1's&lt;br /&gt;
write_byte()	// life in 0.1's&lt;br /&gt;
write_byte()	// line width in 0.1's&lt;br /&gt;
write_byte()	// noise amplitude in 0.01's&lt;br /&gt;
write_byte()	// Red&lt;br /&gt;
write_byte()	// Green&lt;br /&gt;
write_byte()	// Blue&lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2: TE_GUNSHOT ==&lt;br /&gt;
Creates a particle effect plus a ricochet sound.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the gunshot effect&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_GUNSHOT 2			// particle effect plus ricochet sound&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_GUNSHOT)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 3: TE_EXPLOSION ==&lt;br /&gt;
Creates an additive sprite, 2 dynamic lights, flickering particles, explosion sound, and moves the sprite vertically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the explosion effect&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/zerogxplode.spr&amp;quot;&lt;br /&gt;
|The additive sprite to use in the explosion&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scale&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 1&lt;br /&gt;
|The scale of the sprite in the explosion, in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Flags&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-15&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|Sets flags for the explosion, you may also add these together:&lt;br /&gt;
*0: Default Half-Life explosion&lt;br /&gt;
*1: Sprite will be drawn opaque&lt;br /&gt;
*2: Do not render the dynamic lights&lt;br /&gt;
*4: Do not play the explosion sound&lt;br /&gt;
*8: Do not draw the particles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_EXPLOSION 3			// additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_EXPLOSION)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index&lt;br /&gt;
write_byte()	// scale in 0.1's&lt;br /&gt;
write_byte()	// framerate&lt;br /&gt;
write_byte()	// flags&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 4: TE_TAREXPLOSION ==&lt;br /&gt;
Creates the Quake 'tar' explosion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the effect&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_TAREXPLOSION 4		// Quake1 &amp;quot;tarbaby&amp;quot; explosion with sound&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_TAREXPLOSION)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 5: TE_SMOKE ==&lt;br /&gt;
Creates a rising alphablend sprite at 30 pps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Pos&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Position of the smoke effect&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/steam1.spr&amp;quot;&lt;br /&gt;
|The alphablend sprite to use for smoke&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scale&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 1&lt;br /&gt;
|The scale of the smoke, in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_SMOKE 5			// alphablend sprite, move vertically 30 pps&lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin&lt;br /&gt;
write_byte(TE_SMOKE)&lt;br /&gt;
write_coord()	// start position&lt;br /&gt;
write_coord()&lt;br /&gt;
write_coord()&lt;br /&gt;
write_short()	// sprite index &lt;br /&gt;
write_byte()	// scale in 0.1's &lt;br /&gt;
write_byte()	// framerate &lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TO DO: Add rest of TempEnts&lt;br /&gt;
&lt;br /&gt;
[[Category:Half-Life 1]]&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2544</id>
		<title>Temp Entity Events (Half-Life 1)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Temp_Entity_Events_(Half-Life_1)&amp;diff=2544"/>
		<updated>2006-02-01T08:24:55Z</updated>

		<summary type="html">&lt;p&gt;Vittu: Started to add list of HL const.h TempEnts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add Main Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Message Types=&lt;br /&gt;
Sets the type of message the temp entity is transmitted in.&lt;br /&gt;
&lt;br /&gt;
MSG_ types that can be used for ''dest'' in [http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=262 message_begin] are listed below:&lt;br /&gt;
&amp;lt;pre&amp;gt;#define MSG_BROADCAST		0	// unreliable to all&lt;br /&gt;
#define MSG_ONE			1	// reliable to one (msg_entity)&lt;br /&gt;
#define MSG_ALL			2	// reliable to all&lt;br /&gt;
#define MSG_INIT			3	// write to the init string&lt;br /&gt;
#define MSG_PVS			4	// Ents in PVS of org&lt;br /&gt;
#define MSG_PAS			5	// Ents in PAS of org&lt;br /&gt;
#define MSG_PVS_R			6	// Reliable to PVS&lt;br /&gt;
#define MSG_PAS_R			7	// Reliable to PAS&lt;br /&gt;
#define MSG_ONE_UNRELIABLE	8	// Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)&lt;br /&gt;
#define MSG_SPEC			9	// Sends to all spectator proxies&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= TempEnt Events =&lt;br /&gt;
Add Description Here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 0: TE_BEAMPOINTS ==&lt;br /&gt;
Creates a beam between two points.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Start&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of primary entity, or 0 0 0&lt;br /&gt;
|Starting point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| End&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| X Y Z (coords)&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Origin of secondary entity, or 0 0 0&lt;br /&gt;
|Ending point of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Sprite&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| sprite path&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| &amp;quot;sprites/laserbeam.spr&amp;quot;&lt;br /&gt;
|The sprite to use in the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameStart&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame to start with in the sprite&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| FrameRate&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The frame rate to show the sprite at, in 0.1s (10 = 1 fps)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Life&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 50&lt;br /&gt;
|The length of time the beam shall remain, in 0.1s (50 = 5 seconds)&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Width&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The width of the beam in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Noise&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 10&lt;br /&gt;
|The noise amplitude of the beam, this controls how much the beam distorts, again in 0.1s&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Color&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| R G B&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 255 255 255&lt;br /&gt;
|The color of the beam in the RBG triplet value&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Brightness&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 127&lt;br /&gt;
|The brightness of the beam&lt;br /&gt;
|-&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| Scroll&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0-255&lt;br /&gt;
|nowrap=&amp;quot;1&amp;quot;| 0&lt;br /&gt;
|The scroll speed of the beam, in 0.1s (??)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;#define TE_BEAMPOINTS 0			// beam effect between two points &lt;br /&gt;
&lt;br /&gt;
message_begin(MSG_ ,SVC_TEMPENTITY)	// message begin &lt;br /&gt;
write_byte(TE_BEAMPOINTS) &lt;br /&gt;
write_coord()	// start position &lt;br /&gt;
write_coord() &lt;br /&gt;
write_coord() &lt;br /&gt;
write_coord()	// end position &lt;br /&gt;
write_coord() &lt;br /&gt;
write_coord() &lt;br /&gt;
write_short()	// sprite index &lt;br /&gt;
write_byte()	// starting frame &lt;br /&gt;
write_byte()	// frame rate in 0.1's &lt;br /&gt;
write_byte()	// life in 0.1's &lt;br /&gt;
write_byte()	// line width in 0.1's &lt;br /&gt;
write_byte()	// noise amplitude in 0.01's &lt;br /&gt;
write_byte()	// Red &lt;br /&gt;
write_byte()	// Green &lt;br /&gt;
write_byte()	// Blue &lt;br /&gt;
write_byte()	// brightness&lt;br /&gt;
write_byte()	// scroll speed in 0.1's &lt;br /&gt;
message_end()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1: TE_BEAMENTPOINT ==&lt;br /&gt;
Creates a beam between the primary entity and a point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
! Option || Range || Default || Description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Format ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Half-Life 1]]&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Pawn_Tutorial&amp;diff=2328</id>
		<title>Pawn Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Pawn_Tutorial&amp;diff=2328"/>
		<updated>2006-01-19T16:37:11Z</updated>

		<summary type="html">&lt;p&gt;Vittu: fixed typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{qnotice|This guide is rather hardcoded to [[AMX Mod X]].  It needs to be mode generic.}}&lt;br /&gt;
&lt;br /&gt;
This guide is designed to give you a more in-depth overview of the basics of programming in [[Pawn]].&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
Pawn is an embeddable, (almost) typeless, easy to use scripting language that is compiled for a virtual machine. [[AMX Mod X]] uses Pawn to route scripting functions to the Half-Life engine, using the Pawn [[Virtual Machine]] and [[Metamod]] ([[Pawn]] is written in C, Metamod is written in C++). While you write Pawn scripts in a text editor, the scripts must be compiled with a &amp;quot;Compiler&amp;quot;, which produces a binary for AMX Mod X. The AMX Mod X team distributes a specially modified Pawn compiler.&lt;br /&gt;
&lt;br /&gt;
Programming scripts in Pawn is relatively easy, and does not have concepts in other languages that are unnecessary for general use, such as pointers, vectors, structs, classes, allocation, et cetera. &lt;br /&gt;
&lt;br /&gt;
==Language Paradigms==&lt;br /&gt;
Pawn was originally named &amp;quot;[[Small]]&amp;quot; to emphasize the size of the language specification.  The language sacrifices many features found in modern languages to achieve simplicity and speed, which are required for embedded uses.&lt;br /&gt;
*No typing&lt;br /&gt;
**Pawn only has one data type -- the &amp;quot;[[Cell_(Pawn)|cell]]&amp;quot;.  It is the size of the processor's integral pointer (4 bytes for 32bit processor, 8 bytes for 64bit processors).  This has two major implications - Pawn bytecode is processor specific, and pointers can fit inside a cell.&lt;br /&gt;
**[[Tagging_(Pawn)|Tagging]] - Pawn lets you create weakly statically typed &amp;quot;tags&amp;quot;, which can be associated with variables for primitive operator overloading.  For example, Pawn has no concept of floating point numbers (only integers).  Instead, operators are overloaded with the Float: tag to redirect computation to new functions.  Tag-checking is only enforced as a warning.&lt;br /&gt;
**Since Pawn only has one datatype, it does not support structs, records, objects, or anything else.&lt;br /&gt;
**Pawn &amp;lt;i&amp;gt;does&amp;lt;/i&amp;gt; support arrays of cells, which leads to C-style arrays for strings.&lt;br /&gt;
*No garbage collection&lt;br /&gt;
**Pawn has no &amp;quot;heap&amp;quot; allocation built-in.  All variables are stored on the stack or in the data section.  Therefore, no garbage collection is necessary and memory leaks are not possible from the language specification alone.&lt;br /&gt;
*Procedural&lt;br /&gt;
**Pawn is entirely comprised of single, non-nested subroutines.  There are no lambda functions, member functions, constructors, et cetera.  Functions can either be internal (within the script) or public (exposed to the VM by name, like C's &amp;quot;extern&amp;quot;).&lt;br /&gt;
*No thread-safety&lt;br /&gt;
**Pawn is targetted toward single-thread instances.&lt;br /&gt;
&lt;br /&gt;
==Implementation Features==&lt;br /&gt;
*Cross-platform compatible compiler, which outputs bytecode and debug browsing information.&lt;br /&gt;
*Cross-platform compatible Virtual Machine (VM), with support for debug browsing, halting/stopping execution, and interacting with scripts from C/C++ libraries.&lt;br /&gt;
*IA32 JIT Compiler for vastly increasing script execution time.&lt;br /&gt;
&lt;br /&gt;
Because the footprints of the VM and JIT are so small, Pawn is ideal inside games which need a simple and highly fast event system, embedded devices or applications, and realtime systems.&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
Pawn is licensed under the [[ZLib/libpng_License]] license.&lt;br /&gt;
&lt;br /&gt;
=Variables=&lt;br /&gt;
Variables are simple structures for holding data throughout a period of time in your script.&lt;br /&gt;
&lt;br /&gt;
==Types==&lt;br /&gt;
Small has just three data types for declaring variables. The default variable type is a regular whole number, or integer. A variable name, for backwards compatibility, should be 19 characters or less, and MUST start with a letter. It can contain the symbols A-Z, a-z, 0-9, and the underscore (&amp;quot;_&amp;quot;). It is important to note that variable names are case sensitive - &amp;quot;myvar&amp;quot;, &amp;quot;MyVaR&amp;quot;, and &amp;quot;MYVAR&amp;quot; are three separate symbols. &lt;br /&gt;
&lt;br /&gt;
===Integers===&lt;br /&gt;
The simplest data type in Pawn is an &amp;quot;integer&amp;quot;.  Integers are whole numbers.  To declare a new integer variable, use the &amp;quot;new&amp;quot; operator like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;new a            //Declare empty variable &amp;quot;a&amp;quot;&lt;br /&gt;
new b=5          //Declare variable &amp;quot;b&amp;quot; and set it to 5.&lt;br /&gt;
new c=5.0        //This is invalid, technically not a whole number!&lt;br /&gt;
new d=&amp;quot;hello&amp;quot;    //&amp;quot;hello&amp;quot; is not a number either, this is invalid.&lt;br /&gt;
&lt;br /&gt;
//You can also declare multiple variables on one line:&lt;br /&gt;
new e,f,g,h&lt;br /&gt;
new x=7, y=3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Floats===&lt;br /&gt;
You can also declare a variable as a &amp;quot;Float&amp;quot;, which means it can store numbers with decimal places. These are called &amp;quot;floating point&amp;quot; numbers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new Float:a            //Declare empty floating point variable &amp;quot;a&amp;quot;&lt;br /&gt;
new Float:b=5.3        //This will declare a new variable &amp;quot;b&amp;quot; and assign 5.3 to it.&lt;br /&gt;
new Float:c=5          //This is valid, but the compiler will give you a warning.&lt;br /&gt;
new Float:d=&amp;quot;hello&amp;quot;    //This is invalid, &amp;quot;hello&amp;quot; is not a decimal number.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//float(n) is a function that takes a number n and makes it a&lt;br /&gt;
// floating point number.&lt;br /&gt;
new Float:var = float(5)&lt;br /&gt;
new Float:var2 = 5.0     &lt;br /&gt;
new Float:var3 = 1.0*5&lt;br /&gt;
new var4 = floatround(5.0)     &lt;br /&gt;
//Note: floatround(n) is a function that takes a number n and rounds it to a whole number.&lt;br /&gt;
//  this makes the assignment to a regular integer variable valid.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note - Spacing does generally not matter, as long as the compiler can tell symbols apart from each other. If your spacing is REALLY bad, you will get errors or maybe even warnings. For example, &amp;quot;new var = 5&amp;quot; and &amp;quot;new var=5&amp;quot; are the same, but &amp;quot;newvar=5&amp;quot; is totally wrong.&lt;br /&gt;
&lt;br /&gt;
===Booleans===&lt;br /&gt;
The last variable type is &amp;quot;boolean&amp;quot;. It is very simple - it is either &amp;quot;true&amp;quot;, or &amp;quot;false&amp;quot;. Both &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; are predefined data structures.&lt;br /&gt;
&lt;br /&gt;
new bool:IsItOn        //Declares a new variable &amp;quot;IsItOn&amp;quot; which is automatically false&lt;br /&gt;
new bool:xyz=true      //Declares a new variable &amp;quot;xyz&amp;quot; set to true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Arrays=&lt;br /&gt;
&lt;br /&gt;
Pawn features basic &amp;quot;arrays&amp;quot;. An array is a simple type of aggregate data. This means you can store multiple values in one variable! An array follows the same rules as a regular variable, and it has the same types. It simply can contain multiple values. You define an array with brackets, and how many values it can hold. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;//This will declare a variable called &amp;quot;Players&amp;quot; which holds 32 numbers. &lt;br /&gt;
new Players[32]&lt;br /&gt;
//You can now store values in any of the 32 &amp;quot;slots&amp;quot; this array has.  &lt;br /&gt;
// The slots are numbered from 0 to n-1, or in this case, 0 to 31.&lt;br /&gt;
//Every slot starts off as 0.&lt;br /&gt;
&lt;br /&gt;
//Set slot 0 to 5&lt;br /&gt;
Players[0] = 5&lt;br /&gt;
//Set slot 1 to whatever is in slot 0, in this case, the number 5&lt;br /&gt;
Players[1] = Players[0]&lt;br /&gt;
//This is invalid! &lt;br /&gt;
//Although there are 32 slots, they are numbered from 0 to 31.&lt;br /&gt;
//Doing this results in AMX Native Error 4 - AMX_ERR_BOUNDS&lt;br /&gt;
// or, it simply won't compile!&lt;br /&gt;
Players[32] = 15&lt;br /&gt;
//This is also totally invalid           &lt;br /&gt;
Players[-1] = 6&lt;br /&gt;
new a = 3&lt;br /&gt;
//This is also totally invalid.  &lt;br /&gt;
//a must be a constant number, so this is valid:&lt;br /&gt;
new BadArray[a]&lt;br /&gt;
const b = 3&lt;br /&gt;
new GoodArray[b]&lt;br /&gt;
//You can also use Compiler Directives (See last section)&lt;br /&gt;
&lt;br /&gt;
#define ARRAY_SIZE 3&lt;br /&gt;
new Array[ARRAY_SIZE]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arrays can also be declared with groups of data default, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;new Numbers[4] = {0,1,2,3}&lt;br /&gt;
//Note: it is important that you make sure the amount of numbers&lt;br /&gt;
// you pass and the size of the array match&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can also use any data type with arrays:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;//Array of floating points:&lt;br /&gt;
new Float:Numbers[4] = {0.0, 1.2, 2.4, 3.8}&lt;br /&gt;
//Array of booleans.  Note this sets every slot to true.&lt;br /&gt;
new bool:playerHasGun[32] = true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Strings=&lt;br /&gt;
&lt;br /&gt;
You have probably noticed that an important data type is missing - characters (letters and symbols). These are called &amp;quot;strings&amp;quot;, and in Pawn, they are technically numbers! A string   is an array of numbers that translate to ASCII (character) symbols. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This will declare a number array &amp;quot;myString&amp;quot; that contains the data &amp;quot;Hello&amp;quot;.  &lt;br /&gt;
//It will have 6 slots, because there are 5 characters.  &lt;br /&gt;
//The last slot is reserved for the number 0, which tells the Pawn engine that it is a string.&lt;br /&gt;
new myString[] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: anything in between /* and */ is also a comment.  You cannot use /* */ inside a /* */.  The following set of commands achieves the same purpose, however, it is longer and not recommended.  This works because each character of the string &amp;quot;Hello&amp;quot; is stored in a slot in the array.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new myString[6]&lt;br /&gt;
myString[0] = &amp;quot;H&amp;quot;&lt;br /&gt;
myString[1] = &amp;quot;e&amp;quot;&lt;br /&gt;
myString[2] = &amp;quot;l&amp;quot;&lt;br /&gt;
myString[3] = &amp;quot;l&amp;quot;&lt;br /&gt;
myString[4] = &amp;quot;o&amp;quot;&lt;br /&gt;
myString[5] = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{qnotice|&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; Arrays that are meant to be strings must end in a 0, or the null character.  This is so you know where the string ends.}}&lt;br /&gt;
&lt;br /&gt;
You CANNOT do this! While it may compile, it is highly dangerous as it might cause overflow errors.&lt;br /&gt;
&amp;lt;pre&amp;gt;new myString[6]&lt;br /&gt;
myString = &amp;quot;Hello&amp;quot;     //INVALID!&lt;br /&gt;
myString[0] = &amp;quot;Hello&amp;quot;  //INVALID!&lt;br /&gt;
//To add data to a string, you can do this:&lt;br /&gt;
new goodString[7]&lt;br /&gt;
copy(goodString, 6, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we copied 6 cells of the array into an array that can hold 7.  If we were to copy 7 bytes into this array, copy() could potentially copy an extra byte for the Null character, overflowing the array.  This is called a [[buffer overflow]] and must be carefully avoided.&lt;br /&gt;
&lt;br /&gt;
More examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;//Copy is a function that takes three parameters:&lt;br /&gt;
copy(destination[], length, source[])&lt;br /&gt;
//It copies the string inside the source array and places &lt;br /&gt;
// it into the destination array, but only copies up to length characters.&lt;br /&gt;
&lt;br /&gt;
//Lastly, to prove that a string is really an array of numbers, this is completely valid:&lt;br /&gt;
new weird[6]&lt;br /&gt;
weird[0] = 68&lt;br /&gt;
weird[1] = 65&lt;br /&gt;
weird[2] = 73&lt;br /&gt;
weird[3] = 86&lt;br /&gt;
weird[4] = 68&lt;br /&gt;
weird[5] = 0&lt;br /&gt;
//This will set the variable &amp;quot;weird&amp;quot; to the string &amp;quot;DAVID&amp;quot;.&lt;br /&gt;
//To see how letters and symbols translate into numbers, visit www.asctiitable.com &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Functions=&lt;br /&gt;
&lt;br /&gt;
Pawn allows you to define your own functions. This comes in handy for removing code that is used in multiple places. Note that all functions should return a value. To do this, you use the &amp;quot;return&amp;quot; command, which immediately halts the function and returns the value of the expression passed to it. No code is executed in a function once the return is found. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This is a function that takes no parameters and returns 1.&lt;br /&gt;
//When activated, it uses the (non-existant) print function.&lt;br /&gt;
show()&lt;br /&gt;
{&lt;br /&gt;
   print(&amp;quot;Hello!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
   return 1   //End, return 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Activate like this:&lt;br /&gt;
show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also declare functions to take parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This declares a function called &amp;quot;add_two_numbers&amp;quot;, which takes two numbers and returns the sum.&lt;br /&gt;
add_two_numbers(first, second)&lt;br /&gt;
{&lt;br /&gt;
   new sum = first + second&lt;br /&gt;
&lt;br /&gt;
   return sum  //Return the sum&lt;br /&gt;
}&lt;br /&gt;
//Then you can use your new function like this:&lt;br /&gt;
&lt;br /&gt;
new a,b&lt;br /&gt;
a = 5&lt;br /&gt;
a = 12&lt;br /&gt;
new c = add_two_numbers(a,b)&lt;br /&gt;
//c will now be equal to 17.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You are not limited by what types of data parameters can accept. When you give parameters to a function, it is called &amp;quot;passing&amp;quot;. You can pass either data or a variable to a function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This defines a new function called &amp;quot;add_two_floats&amp;quot;&lt;br /&gt;
// which takes two floating points and returns the sum&lt;br /&gt;
Float:add_two_floats(Float:first, Float:second)&lt;br /&gt;
{&lt;br /&gt;
   new Float:sum = first + second&lt;br /&gt;
&lt;br /&gt;
   return sum&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
new Float:a&lt;br /&gt;
new Float:b&lt;br /&gt;
a = 5.0&lt;br /&gt;
b = 6.3&lt;br /&gt;
new Float:c&lt;br /&gt;
c = add_two_floats( a+b )&lt;br /&gt;
//c is now equal to 11.3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can even pass arrays!  You do not have to specify the size of the array.  If you do, you must make sure you are calling the function with an array of equal size and type.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add_two_from_array(array[], a, b)&lt;br /&gt;
{&lt;br /&gt;
   new first = array[a]&lt;br /&gt;
   new second = array[b]&lt;br /&gt;
   new sum = add_two_numbers(first, second)   //use our function from earlier&lt;br /&gt;
  &lt;br /&gt;
   return sum&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that when you pass arrays through a function they are passed through what is called &amp;quot;by reference&amp;quot;. When a normal variable is passed to a function, it is copied in memory, and the copy is sent and then deleted afterwards. This is not the case with an array. Because arrays can be very large, the array is &amp;quot;referenced&amp;quot; instead of copied. This means if you change the array, afterwards it will stay changed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This function will switch slots a and b inside any array passed to this function.&lt;br /&gt;
swap_slots(array[], a, b)&lt;br /&gt;
{&lt;br /&gt;
   //Note, you need to temporarily hold one of the slots before swapping them&lt;br /&gt;
   //Otherwise, you can't swap both values! This is a classic problem.&lt;br /&gt;
   //If you have a and b, setting b equal to a eliminates the original value in b.&lt;br /&gt;
   new temp&lt;br /&gt;
             &lt;br /&gt;
   temp = array[b]&lt;br /&gt;
   array[b] = array[a]&lt;br /&gt;
   array[a] = temp&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
new myArray[2]&lt;br /&gt;
myArray[0] = 5&lt;br /&gt;
myArray[1] = 6&lt;br /&gt;
swap_slots(myArray, 0, 1)&lt;br /&gt;
//myArray[0] is 6, myArray[1] is 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can prevent arrays from being modified by declaring them &amp;quot;constant&amp;quot;, like so:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
add_two_from_array(const array[], a, b)&lt;br /&gt;
{&lt;br /&gt;
   new first = array[a]&lt;br /&gt;
   new second = array[b]&lt;br /&gt;
   new sum = add_two_from_array(first, second)&lt;br /&gt;
   return sum&lt;br /&gt;
}&lt;br /&gt;
//Note, now when you use the function, you are guaranteed that the array will not be modified.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function modifies an array passed as a constant.  It will not work.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bad_function(const array[])&lt;br /&gt;
{&lt;br /&gt;
   array[0] = 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Expressions=&lt;br /&gt;
&lt;br /&gt;
Expressions are just what they sound like from mathematics. They are groupings of symbols that return one piece of data. Expressions are normally comprised of parenthetical expressions, and are evaluated in a certain order (from innermost to outermost, parenthesis first, then multiplication, division, addition, subtraction, et cetera). You can put expressions anywhere. You can set variables equal to them or pass them to functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;//This is the simplest expression.  It returns the number zero.&lt;br /&gt;
0&lt;br /&gt;
//However, to make it easier to read, this is also valid:&lt;br /&gt;
(0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If an expression is not zero or it is not false, it not only returns a value, it also returns &amp;quot;true&amp;quot;. Otherwise, it will return 0, which is also &amp;quot;false&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Here are more mathematical expressions.  The mathematical operators are&lt;br /&gt;
// + for addition&lt;br /&gt;
// - for subtraction&lt;br /&gt;
// * for multiplication&lt;br /&gt;
// / for division&lt;br /&gt;
// % for modulus (finding the remainder of one number divided by another (5%2 is 1)&lt;br /&gt;
(5+6)                       //returns 11&lt;br /&gt;
((5*6)+3)                   //returns 33&lt;br /&gt;
((((5+3)/2)*4)-9)           //returns 5&lt;br /&gt;
((5*6) % 7)                 //returns 2&lt;br /&gt;
//Here are other expressions:&lt;br /&gt;
(true)                      //returns true&lt;br /&gt;
(5.0 + 2.3)                 //returns 7.3 as a floating point&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are also extensions of these operators for direct use on variables.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new a = 5&lt;br /&gt;
new b = 6&lt;br /&gt;
//The first are the post/pre increment and decrement operators.&lt;br /&gt;
a++          //returns a+1, or 6.  This is a post increment.&lt;br /&gt;
++a          //also returns a+1, or 6.  This is a pre increment.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference between the two is subtle but important. a++ is evaluated LAST in an expression, while ++a is evaluated FIRST. This differences comes in handy with code that uses loops in certain ways. It is also important to know that the increment/decrement operators will not only return a+1, but set the variable a to a+1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a--          //returns 4, post decrement&lt;br /&gt;
--a          //returns 4, pre decrement&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a++ essentially trims down this code:&lt;br /&gt;
&amp;lt;pre&amp;gt;a = a + 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
However, there is another way to write lines of code of this form:&lt;br /&gt;
&amp;lt;pre&amp;gt;a = a OP y&amp;lt;/pre&amp;gt;&lt;br /&gt;
Where OP is a math operator.  It can be shortened to:&lt;br /&gt;
&amp;lt;pre&amp;gt;a OP= x&amp;lt;/pre&amp;gt;&lt;br /&gt;
Observe:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
a += 1       //This sets a to a + 1&lt;br /&gt;
a -= b       //This sets b to a - b&lt;br /&gt;
a *= 0       //This multiplies a by 0&lt;br /&gt;
a /= 2       //This divides a by 2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, mathematical operators are not the only operators you are given. There are boolean operators to help you with logical circuits or logical decisions.&lt;br /&gt;
&lt;br /&gt;
The and operator takes in the left expression and right expression.  If both are &amp;quot;true&amp;quot;, then it returns true.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This is false, because 1 returns true and 0 returns false.  &lt;br /&gt;
//Since both are not true, &amp;amp;&amp;amp; returns false.&lt;br /&gt;
(1 &amp;amp;&amp;amp; 0)&lt;br /&gt;
(1 &amp;amp;&amp;amp; 2)                    //Both numbers are &amp;quot;true&amp;quot;, therefore the expression is true.&lt;br /&gt;
(true &amp;amp;&amp;amp; false)             //false&lt;br /&gt;
(false &amp;amp;&amp;amp; false)            //false&lt;br /&gt;
(true &amp;amp;&amp;amp; true)              //true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The other important operator is &amp;quot;or&amp;quot;.  It returns true if one of two expressions are true.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(1 || 0)                    //true, since one of the values is true.&lt;br /&gt;
(1 || 2)                    //true&lt;br /&gt;
(true || true)              //true&lt;br /&gt;
(false || false)            //false&lt;br /&gt;
(true || true)              //true&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are other operators as well, that you may not use as often. The &amp;quot;bitwise and&amp;quot; operator returns whether a binary bit sequence is contained in another sequence. In the technical terms, it does an &amp;quot;and (&amp;amp;&amp;amp;)&amp;quot; operation on each of the bits in both numbers. For example, say you have the number &amp;quot;9&amp;quot;, which is &amp;quot;1001&amp;quot; in binary. If you want to know if that sequence contains the number &amp;quot;8&amp;quot; (1000), you can do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This will return 8, which means 8 is indeed a bit in 9.&lt;br /&gt;
(9 &amp;amp; 8)&lt;br /&gt;
//4 (00100) is not a bit inside 16 (10000) and this will return 0.&lt;br /&gt;
(16 &amp;amp; 4)&lt;br /&gt;
//The next operator is &amp;quot;bitwise or&amp;quot; &lt;br /&gt;
//which does an &amp;quot;or (||)' operation on each of the bits in both numbers.&lt;br /&gt;
//This will take 9 (1001) and match it with 3 (0011), resulting in 1011, or 11.&lt;br /&gt;
(9 | 3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two operators are also important, but not used often. They are the bitwise shift operators, &amp;lt;&amp;lt; is a left shift and &amp;gt;&amp;gt; is a right shift. They shift the bits in a number to one direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This takes the number 3 (00011) and shifts it three places to binary (11000), or 24.&lt;br /&gt;
(3 &amp;lt;&amp;lt; 3)&lt;br /&gt;
//This takes the number 24 (11000) and shifts it three places to binary (00011), or 3.&lt;br /&gt;
(24 &amp;gt;&amp;gt; 3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last operator is &amp;quot;bitwise not&amp;quot;. It returns the exact opposite of whatever is given to it. When used on a number, it will return each of the bits flipped (1 to 0, 0 to 1).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This returns false&lt;br /&gt;
(!true)&lt;br /&gt;
//This returns true&lt;br /&gt;
(!false)&lt;br /&gt;
//This takes 9 (binary 1001) and makes it 6 (binary 0110).&lt;br /&gt;
(!(9))                      &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conditionals=&lt;br /&gt;
&lt;br /&gt;
Conditionals allow you to test if an expression meets a standard, and to execute code based on that decision. &lt;br /&gt;
&lt;br /&gt;
==If Statements==&lt;br /&gt;
&lt;br /&gt;
The most important conditional is called &amp;quot;if ... then&amp;quot;. If evaluates whether a given expression is true or false. It if is true, it executes a block of code. If not, it executes a different block of code. For example:&lt;br /&gt;
&lt;br /&gt;
This is an example of the most basic if ... then statement. The first line checks to see if the expression is true. In this case, if the variable a is equal to 5, then the if statement will execute the block of code underneath it, which sets a to 6.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if (a == 5)&lt;br /&gt;
{&lt;br /&gt;
   a = 6&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, what happens if a does not equal 5? Then the code will not be executed. However, you can tell it to execute code if the conditions are not met. Now, if a is equal to 5, a will be set to 6. Otherwise, it will be set to 7.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if (a == 5)&lt;br /&gt;
{&lt;br /&gt;
   a = 6&lt;br /&gt;
} else {&lt;br /&gt;
   a = 7&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are many different operators you can use inside the if () statement. In fact, you can use any [[#Expressions|expression]] that evaluates to true (not zero) or false (zero).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This will return true if a does not equal 5&lt;br /&gt;
if (a != 5) {&lt;br /&gt;
//Returns true if a is greater than 5&lt;br /&gt;
if (a &amp;gt; 5) {&lt;br /&gt;
//Returns true if a is less than 5&lt;br /&gt;
if (a &amp;lt; 5) {&lt;br /&gt;
//Returns true if a is greater than or equal to 5&lt;br /&gt;
if (a &amp;gt;= 5) {&lt;br /&gt;
//Returns true if a is less than or equal to 5&lt;br /&gt;
if (a &amp;lt;= 5) {&lt;br /&gt;
//Returns true because 11 is true&lt;br /&gt;
if (5+6) {&lt;br /&gt;
//Returns true of both a and b are true&lt;br /&gt;
if (a &amp;amp;&amp;amp; b) {&lt;br /&gt;
//Returns true if 7.5 is greater than c&lt;br /&gt;
if ( ((5*3)/2) &amp;gt; c) {&lt;br /&gt;
//Always returns true no matter what&lt;br /&gt;
if (true) {&lt;br /&gt;
//Never returns true&lt;br /&gt;
if (false) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that array comparisons have restrictions. This is invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
my arrayOne[3]&lt;br /&gt;
my arrayTwo[3]&lt;br /&gt;
if (arrayOne == arrayTwo) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if ((arrayOne[0] == arrayTwo[0]) &amp;amp;&amp;amp; &lt;br /&gt;
    (arrayOne[1] == arrayTwo[1]) &amp;amp;&amp;amp; &lt;br /&gt;
    (arrayOne[2] == arrayTwo[2])) {&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously, this would get very tedious with large arrays. You will see later on how to easily compare strings and arrays.&lt;br /&gt;
&lt;br /&gt;
The if...then model of conditional switching can be brought up to another level. Pawn provides a way for you to provide multiple levels of true and false expressions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Example of &amp;quot;if...else if&amp;quot;&lt;br /&gt;
if (a == 5) {&lt;br /&gt;
   //This code will be run if a is 5.&lt;br /&gt;
} else if (a &amp;lt; 6) {&lt;br /&gt;
   //This code will be run if a is less than 6&lt;br /&gt;
} else if (a == 7) {&lt;br /&gt;
   //This code will be run if a is 7.&lt;br /&gt;
} else {&lt;br /&gt;
   //If none of the above conditions are met, this code will be run.&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is important to note that in the above example, each code block is not &amp;quot;fall through&amp;quot;. That means each of the conditions will be checked in order, and if one is true, the code will be executed and the if statement is done. It will not execute multiple true conditions.&lt;br /&gt;
&lt;br /&gt;
==Switch Statements==&lt;br /&gt;
&lt;br /&gt;
Lastly, there is one last type of conditional statement. It is called a &amp;quot;switch&amp;quot; statement, and it allows you to make a nicely ordered list of conditions similar to, but not as powerful as, &amp;quot;if...else if&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;//Example of a switch statement&lt;br /&gt;
switch (a)&lt;br /&gt;
{&lt;br /&gt;
    case 5:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 5&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    case 6:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 6&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    case 7:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 7&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    default:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if all other cases fail&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a switch is not &amp;quot;fall-through&amp;quot;. If a case is true, no other cases are evaluated.&lt;br /&gt;
&lt;br /&gt;
=Looping=&lt;br /&gt;
&lt;br /&gt;
Looping is essential for any language. It allows you to perform the same block of code over and over, by constructing conditions on which code should be repeated.&lt;br /&gt;
&lt;br /&gt;
==For Loops==&lt;br /&gt;
&lt;br /&gt;
The first and most widely used loop is called a &amp;quot;for loop&amp;quot;. It takes an initial value, a condition upon which it should stop, and an incremental step. Then it executes code until it the conditions are no longer true. This lets you repeat the same block of code any number of times. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*A for loop has three parameters:&lt;br /&gt;
  for (initial; condition; increment)&lt;br /&gt;
  {&lt;br /&gt;
    //your code here&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  Before the first loop executes, it runs your initial condition.&lt;br /&gt;
  Then it begins looping your code with these steps:&lt;br /&gt;
  1.  Check if the condition is true.  If so, continue.  If not, stop.&lt;br /&gt;
  2.  Run the code.&lt;br /&gt;
  3.  Run the &amp;quot;increment&amp;quot; parameter.&lt;br /&gt;
  4.  Go to step 1.&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
//Example of a for loop&lt;br /&gt;
new i&lt;br /&gt;
new sum&lt;br /&gt;
for (i=1; i&amp;lt;=10; i++)&lt;br /&gt;
{&lt;br /&gt;
   sum += i&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
#The first parameter, i=1, sets the i variable to one. This happens before the looping starts.&lt;br /&gt;
#Next, the &amp;quot;increment&amp;quot; parameter is checked. This parameter is a post-increment operator, so 1 will be added to i after the entire code block is evaluated.&lt;br /&gt;
#Then the condition is checked. Is i&amp;lt;=10? It is currently 1, so it is indeed less than or equal to 10.&lt;br /&gt;
#Since the condition is true, sum+=i is executed. This means i is added into sum.&lt;br /&gt;
#The code block has finished, and i++ increments i to 2.&lt;br /&gt;
#Now it repeats.&lt;br /&gt;
#Is i&amp;lt;=10? Yes, it is 2. Now sum+=i runs again, and now sum is equal to 3.&lt;br /&gt;
#The code block has finished, and i now increments to 3.&lt;br /&gt;
#This happens until...&lt;br /&gt;
#The increment parameter sets i to 11. The condition is no longer true, and the for loop is finished.&lt;br /&gt;
#The sum variable now holds the number 55, which is the sum of 1 through 10.&lt;br /&gt;
&lt;br /&gt;
This provides a nice way of managing arrays!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Note: this provides a nice way to loop through arrays!  Observe this function below.&lt;br /&gt;
sum_of_array(myArray[], size)&lt;br /&gt;
{&lt;br /&gt;
   //Note: Make sure the user passes the size of the array, so we don't overflow it.&lt;br /&gt;
   new i, sum&lt;br /&gt;
  &lt;br /&gt;
   //This loop will start at 0 and stop right before size is reached.&lt;br /&gt;
   //If the user passes the correct size of the array, &lt;br /&gt;
   // the loop will be going from 0 to size-1&lt;br /&gt;
   // This correctly matches the numbers of slots in the array.&lt;br /&gt;
   for  (i=0; i&amp;lt;size; i++)&lt;br /&gt;
   {&lt;br /&gt;
      //For every time this loop executes, &lt;br /&gt;
      // i will be a number from 0 to size-1&lt;br /&gt;
      //Add the value of the slot (i) in the array to sum.&lt;br /&gt;
      //Once this is finished, sum will contain &lt;br /&gt;
      // the sum of all slots in the array.&lt;br /&gt;
      sum += myArray[i]&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return sum&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
new NumberArray[4]&lt;br /&gt;
NumberArray[0] = 3&lt;br /&gt;
NumberArray[1] = 1&lt;br /&gt;
NumberArray[2] = 4&lt;br /&gt;
NumberArray[3] = 1&lt;br /&gt;
&lt;br /&gt;
new answer = sum_of_array(NumberArray, 4)&lt;br /&gt;
//answer will be 3+1+4+1, or 9&lt;br /&gt;
&lt;br /&gt;
//Here is a function to compare if one array is equal to another (i.e. a string)&lt;br /&gt;
bool:compare_arrays(array1[], array2[], size)&lt;br /&gt;
{&lt;br /&gt;
   new i&lt;br /&gt;
   for (i=0; i&amp;lt;size, i++)&lt;br /&gt;
   {&lt;br /&gt;
      //If a slot does not match, halt the function and return false.&lt;br /&gt;
      if (array1[i] != array2[i])&lt;br /&gt;
      {&lt;br /&gt;
         return false&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   //If the function got to this point without returning false, return true.&lt;br /&gt;
   return true&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==While Loops==&lt;br /&gt;
&lt;br /&gt;
The next kind of loop is also very important, and is simpler than a for loop. Called a &amp;quot;while&amp;quot; loop, it only takes one parameter: a condition. As long as the condition is true, it keeps executing code. See the above examples rewritten with while loops.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Basic loop&lt;br /&gt;
new i=0&lt;br /&gt;
new sum&lt;br /&gt;
&lt;br /&gt;
while (++i &amp;lt;= 10)&lt;br /&gt;
{&lt;br /&gt;
   sum+=i&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sum_of_array(array[], size)&lt;br /&gt;
{&lt;br /&gt;
   new i=0, sum&lt;br /&gt;
&lt;br /&gt;
   //Do this loop while i is less than the size.&lt;br /&gt;
   //i is incremented at the end of every loop.&lt;br /&gt;
   while (i++ &amp;lt; size)&lt;br /&gt;
   {&lt;br /&gt;
      sum += array[i]&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return sum&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool:compare_arrays(array1[], array2[], size)&lt;br /&gt;
{&lt;br /&gt;
   new i&lt;br /&gt;
   while (i++ &amp;lt; size)&lt;br /&gt;
   {&lt;br /&gt;
      if (array1[i] != array2[i])&lt;br /&gt;
      {&lt;br /&gt;
         return false&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return true&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Two Dimensional Arrays==&lt;br /&gt;
&lt;br /&gt;
In Pawn it is possible to have arrays where each slot is another array. This is very useful for storing a table of data, where the first section of slots is a row and the second section of slots is a column. Two dimensional arrays are declared like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This declares an array with 50 rows and 50 columns.&lt;br /&gt;
new BigArray[50][50]&lt;br /&gt;
//this declares a floating point array with 25 rows and 10 columns.&lt;br /&gt;
new Float:BigArray[25][10]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each slot in the first subset of the array becomes its own array.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new BigArray[3][3]&lt;br /&gt;
BigArray[0][0] = 10&lt;br /&gt;
BigArray[0][1] = 20&lt;br /&gt;
BigArray[0][2] = 30&lt;br /&gt;
BigArray[1][0] = 40&lt;br /&gt;
BigArray[1][1] = 50&lt;br /&gt;
BigArray[1][2] = 60&lt;br /&gt;
BigArray[2][0] = 70&lt;br /&gt;
BigArray[2][1] = 80&lt;br /&gt;
BigArray[2][2] = 90&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will result in BigArray looking like this:&lt;br /&gt;
:{|&lt;br /&gt;
|-&lt;br /&gt;
| BigArray&lt;br /&gt;
| 0&lt;br /&gt;
| 1&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 10&lt;br /&gt;
| 20&lt;br /&gt;
| 30&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 40&lt;br /&gt;
| 50&lt;br /&gt;
| 60&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 70&lt;br /&gt;
| 80&lt;br /&gt;
| 90&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that our old sum_of_array() function can still work! We can do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;new sum = sum_of_array(BigArray[2], 3)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because BigArray[2] contains a second, single dimensional array, containing {7,8,9}. However, let's write a 2D sum of array function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This function will tally up a two dimensional array.&lt;br /&gt;
sum_of_table(array[][], rows, cols)&lt;br /&gt;
{&lt;br /&gt;
   new i, j, sum&lt;br /&gt;
&lt;br /&gt;
   //Note, there is a loop inside the loop.  &lt;br /&gt;
   //This lets you go through each array inside the   &lt;br /&gt;
   // bigger array. &lt;br /&gt;
   for (i=0; i&amp;lt;rows; i++)&lt;br /&gt;
   {&lt;br /&gt;
      for (j=0; j&amp;lt;cols; j++)&lt;br /&gt;
      {&lt;br /&gt;
         sum += array[i][j]&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   return sum&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, it is also possible to store an array of strings using two dimensional arrays.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
new StringList[3][] = {&amp;quot;Hello&amp;quot;, &amp;quot;my&amp;quot;, &amp;quot;friend&amp;quot;}&lt;br /&gt;
/*&lt;br /&gt;
  StringList[0][0] through [0][5] contains &amp;quot;Hello&amp;quot;&lt;br /&gt;
  StringList[1][0] through [1][2] contains &amp;quot;my&amp;quot;&lt;br /&gt;
  StringList[2][0] through [1][6] contains &amp;quot;friend&amp;quot;&lt;br /&gt;
*/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The table for StringList will look like:&lt;br /&gt;
StringList 	0 	1 	2 	3 	4 	5 	6&lt;br /&gt;
0 	H 	e 	l 	l 	o 	\0 	&lt;br /&gt;
1 	m 	y 	\0 				&lt;br /&gt;
2 	f 	r 	i 	e 	n 	d 	\0&lt;br /&gt;
&lt;br /&gt;
Comparing strings in multidimensional arrays is also similar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (StringList[0] == &amp;quot;Hello&amp;quot;)       //INVALID&lt;br /&gt;
if (StringList[0][0] == &amp;quot;Hello&amp;quot;)    //INVALID&lt;br /&gt;
if (equali(StringList[0], &amp;quot;Hello&amp;quot;)) //Valid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Compiler Pre-processor Directives=&lt;br /&gt;
&lt;br /&gt;
Compiler directives allow you to change how your code is read. This is rather advanced and will only be run over briefly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//To bind a symbol to a value, you can do this:&lt;br /&gt;
#define SYMBOL VALUE&lt;br /&gt;
//for example:&lt;br /&gt;
&lt;br /&gt;
#define MAX_STRING 250&lt;br /&gt;
new String[MAX_STRING]&lt;br /&gt;
&lt;br /&gt;
#define HELLO &amp;quot;Hello.  This is a generic greeting.&amp;quot;&lt;br /&gt;
new Hello[MAX_STRING] = {HELLO}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use #defines to change the flow of code the compiler makes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if defined LINUX&lt;br /&gt;
   //This portion will be compiled if #define LINUX exists&lt;br /&gt;
   execute_command(&amp;quot;ls -l&amp;quot;)&lt;br /&gt;
#else&lt;br /&gt;
   //This portion will be compiled if #define LINUX does not exist&lt;br /&gt;
   execute_command(&amp;quot;dir&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also change how much memory your script uses.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#pragma dynamic 4096&lt;br /&gt;
//This creates a 16K stack of memory (default).&lt;br /&gt;
//It is measured in blocks of 4 byte cells.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
This guide should have given you a VERY brief introduction to basic Pawn programming. It is by no means comprehensive and it should not constitute the entirety of one's knowledge of Pawn. To read the official Small documentation and language guide, go this website: http://www.compuphase.com/pawn/pawn-lang.pdf (Note, this guide is very long and should be used as a reference. You may want to try the Small forums or the AMX Mod X forums). Continue to the next Section to see how to apply Small programming to the Half-Life and AMX Mod X engine!&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
*[http://www.compuphase.com/pawn/pawn-lang.pdf Pawn Language Reference]&lt;br /&gt;
*[http://www.compuphase.com/pawn/pawn.htm Pawn Homepage]&lt;br /&gt;
*[http://www.compuphase.com/ ITB CompuPhase]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Listen_server&amp;diff=2326</id>
		<title>Listen server</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Listen_server&amp;diff=2326"/>
		<updated>2006-01-19T13:58:58Z</updated>

		<summary type="html">&lt;p&gt;Vittu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is where you start a server from the game itself and play at the same time... there is only a minimal control panel. This requires the Steam Client to always be running. All the stock game content is contained in a single cache file.&lt;/div&gt;</summary>
		<author><name>Vittu</name></author>
		
	</entry>
</feed>