<?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=Seta00</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=Seta00"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/Seta00"/>
	<updated>2026-05-22T19:18:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=AlliedModders_Planning&amp;diff=8058</id>
		<title>AlliedModders Planning</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=AlliedModders_Planning&amp;diff=8058"/>
		<updated>2011-03-16T03:03:13Z</updated>

		<summary type="html">&lt;p&gt;Seta00: /* Phase 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
This is sort of a major push for AlliedModders to be a bit more streamlined.  We're encountering growth problems, especially as our personnel has dwindled quite low recently.  This document discusses some changes I'm proposing.  Anyone is free to discuss this on the forums or add comments into this document.&lt;br /&gt;
&lt;br /&gt;
Everything related to source code management in this document refers to Metamod:Source and SourceMod.  AMX Mod X is considered &amp;quot;mature&amp;quot; and is no longer maintained except for critical or high priority bugs.  If and when we do a move past Subversion, it is unlikely AMX Mod X will follow.  &lt;br /&gt;
&lt;br /&gt;
=The Problems=&lt;br /&gt;
==Short Term==&lt;br /&gt;
*We're finding it hard to manage multiple projects in a unified way.&lt;br /&gt;
*There are site disparities, Metamod:Source and SourceMod and AMX Mod X each have entirely different backends.&lt;br /&gt;
*Similarly, each site has a different version of the mirror system script.  &lt;br /&gt;
*Subversion doesn't cut it -- Mercurial might handle things better.  Subversion basically has no branching or tagging support, and it has no real branch merging capabilities.  This is a real problem for SourceMod which has pretty active development.&lt;br /&gt;
*The packaging system is disorganized and fundamentally broken.  It's inconsistent, inaccurate, and takes up 1.7GB of wasted space and growing.&lt;br /&gt;
&lt;br /&gt;
==Long Term==&lt;br /&gt;
*AlliedModders has plans past SourceMod.  We need to be able to grow our project base without adding exponential amounts of work.&lt;br /&gt;
*We still don't have a main site&lt;br /&gt;
*MediaWiki still has authentication problems since its handling of usernames is broken&lt;br /&gt;
*Flyspray is buggy, definitely non-production, and doesn't get maintained frequently&lt;br /&gt;
*It's impossible to maintain the AMXX/SM/MM:S sites right now&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Mercurial=&lt;br /&gt;
Subversion doesn't let us branch nicely or create user-specific branches without forever mucking up the central repository.  It's difficult to do merges.&lt;br /&gt;
&lt;br /&gt;
An excellent tutorial for how Mercurial works is [http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Phases=&lt;br /&gt;
&lt;br /&gt;
==Phase 0 - Done ==&lt;br /&gt;
'''DONE:''' We've eliminated build numbers and are back on the x.y.z system.&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Apply new versioning scheme, whatever it may be.&amp;lt;/strike&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Phase 1 - Done==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;Move from Sente to Iroh so we can get away from ThePlanet and clean up/optimize some infrastructure.  This is documented at [[Iroh_Migration|Iroh Migration]].&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 2==&lt;br /&gt;
Expected date: Mid-July&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Redo automation so the &amp;quot;packaging&amp;quot; versus &amp;quot;sending upstream&amp;quot; processes are fundamentally separate.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Redo &amp;quot;sending upstream&amp;quot; process so it simply sends over FTP.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Use an SSH tunnel to notify of new packages, so we don't have to do something idiotic like mirrors.pl for the mirror system, or using post-commit scripts on the Packages repository.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*Redo the package system so only 30 days worth of builds are available.&lt;br /&gt;
*&amp;lt;strike&amp;gt;Write a script to help users diff between packages? (Update: No one asked for it.)&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Remove the Packages repository entirely (transitioning AMX Mod X to this will be trivial).&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Update symbol server to include binaries and maybe even sourcecode? Removes the need for fetchdll's.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 3 - Done==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;{{bz|3257}}: Transition SourceMod to vs2k8.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;{{bz|3258}}: Transition Metamod:Source to vs2k8.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 4 - Done==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Move the pdbstore to be centralized client-side.  This can be accomplished by making a more advanced symstore wrapper that will remove anything older than 30 days, and then (in a similar SSH tunnel method as above), rsync all changes upstream to the webserver.  The exact mechanism is still up in the air, but rsync would probably suffice (as long as we can stomach cygwin).&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Remove the Symbols repository.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Rewrite fetchdlls to support the new layout.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 5 - Done==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Add hg.alliedmods.net pointing to our &amp;quot;repository roots,&amp;quot; which will be per-project.  For example, hg.alliedmods.net/sourcemod.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;From there, import trunk as &amp;quot;sourcemod.&amp;quot;&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Branch every major release off as separate repositories, from the appropriate revisions.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Tag minor releases.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Update all links we can find on the site and in the docs.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 6 - Done==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Import mmsource into Mercurial.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Import hl2sdk/hl2sdk-ob into Mercurial.&amp;lt;/strike&amp;gt;&lt;br /&gt;
*&amp;lt;strike&amp;gt;Update all links we can find on the site and in the docs.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 7==&lt;br /&gt;
'''DONE!'''&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;{{bz|3259}}: We need to update vBulletin to the 3.7 branch.  This is potentially a huge task.&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Phase 8==&lt;br /&gt;
Expected date: Q1 2009&lt;br /&gt;
&lt;br /&gt;
We really, really still need a CMS to make this packaging, mirroring, etc business much more streamlined.  But this phase is so far in the future I expect other phases to creep in before it.  This is more a mind dump than anything, but here goes --&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;strike&amp;gt;Moving from flyspray to bugzilla.  After using bugzilla, I'm convinced that its massive feature set far outweights the few permissions issues we ran into.  flyspray is severely lacking, and even though bugzilla isn't the nicest looking tool, it's templated and professionally done.  It has little things that really count, like..&amp;lt;/strike&amp;gt;&lt;br /&gt;
**&amp;lt;strike&amp;gt;The input system isn't broken and convoluted like Flyspray's embedded dokuwiki (which seems to be less a product than a bunch of bugs someone coded)&amp;lt;/strike&amp;gt;&lt;br /&gt;
**&amp;lt;strike&amp;gt;A much, MUCH better attachment system that allows for attachment reviews&lt;br /&gt;
**More focused on triaging and patch management than flyspray, which is simply a list of tasks with some basic statistics&amp;lt;/strike&amp;gt;&lt;br /&gt;
*Moving from MediaWiki, which (I view) as a very, very outdated piece of software.  From version 1.5 to 1.10 I have noticed no real usability or feature set changes, and the installation/upgrade process is always very buggy for us.  Its administration and permissions model is laughably limited.  A possible target for this is DekiWiki which Mozilla is supposedly converting to.  It's open source and it's actually a CMS, which (perhaps) could kill two birds with one stone.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Talk:FakeMeta_Functions_Detailed_Descriptions&amp;diff=7845</id>
		<title>Talk:FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Talk:FakeMeta_Functions_Detailed_Descriptions&amp;diff=7845"/>
		<updated>2010-09-07T16:48:20Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Created page with 'The original content is here: http://forums.alliedmods.net/showthread.php?t=93229  I've just converted the page to Wiki format.  ~~~~'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The original content is here: http://forums.alliedmods.net/showthread.php?t=93229&lt;br /&gt;
&lt;br /&gt;
I've just converted the page to Wiki format.&lt;br /&gt;
&lt;br /&gt;
[[User:Seta00|Seta00]] 16:48, 7 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7844</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7844"/>
		<updated>2010-09-07T16:44:27Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_AlertMessage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_MoveToOrigin ===&lt;br /&gt;
Moves an entity a defined distance toward a coordinate.&lt;br /&gt;
&lt;br /&gt;
If the distance between Entity and Destination is less than the required distance, the entity will pass over that point.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MoveToOrigin, iEnt, Float:Destination[3], Float:Distance, iMoveType)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Destination[3] = A Coordinate toward which the entity moves&lt;br /&gt;
* Distance = The distance to move the entity&lt;br /&gt;
* iMoveType = This is the MOVE_* option used for monsters and players to change the behaviour of the movement&lt;br /&gt;
&lt;br /&gt;
Move type possible values:&lt;br /&gt;
&lt;br /&gt;
 #define MOVE_NORMAL		0	// normal move in the direction monster is facing&lt;br /&gt;
 #define MOVE_STRAFE		1	// moves in direction specified, no matter which way monster is facing&lt;br /&gt;
 #define MOVE_STUCK_DIST		32	// if a monster can't step this far, it is stuck.&lt;br /&gt;
 #define MOVE_START_TURN_DIST	64	// when this far away from moveGoal, start turning to face next goal&lt;br /&gt;
&lt;br /&gt;
==== Caveats ====&lt;br /&gt;
&lt;br /&gt;
* iEnt must be on ground&lt;br /&gt;
* If there's an object closer than Distance that iEnt could collide then the movement is not done&lt;br /&gt;
* If there's a ramp, it works like an object and the movement is not done&lt;br /&gt;
&lt;br /&gt;
== Visibility Functions ==&lt;br /&gt;
=== EngFunc_CheckVisibility ===&lt;br /&gt;
This function is used to check if an entity is in your [[PVS]].&lt;br /&gt;
&lt;br /&gt;
'''It can be used on all entities except worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
This function has a parameter that must be obtained in a special way, the ''pset'' parameter.&lt;br /&gt;
'''Note:''' The parameter is player only, that means that if you get pset for example for a player that has the id ''1''. When you use this function on an entity it will check whether that entity is in [[PVS]] of the Player id ''1''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new g_cl_pset[33]&lt;br /&gt;
&lt;br /&gt;
public plugin_init(id)&lt;br /&gt;
{&lt;br /&gt;
    register_forward(FM_AddToFullPack, &amp;quot;pfw_atfp&amp;quot;, 1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public pfw_atfp(es, e, ent, host, flags, player, set)&lt;br /&gt;
{&lt;br /&gt;
    g_cl_pset[host] = set&lt;br /&gt;
    &lt;br /&gt;
    return FMRES_IGNORED&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock is_ent_in_player_pvs(id, entity)&lt;br /&gt;
{&lt;br /&gt;
    return engfunc(EngFunc_CheckVisibility, entity, g_cl_pset[id])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock get_pvs_players(id, players[32], num, flags[], team[])&lt;br /&gt;
{&lt;br /&gt;
    if (!is_user_connected(id))&lt;br /&gt;
        return 0    &lt;br /&gt;
&lt;br /&gt;
    get_players(players, num, flags, team)&lt;br /&gt;
    &lt;br /&gt;
    for (new i=0;i&amp;lt;num;i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (!is_ent_in_player_pvs(id, players[i]))&lt;br /&gt;
        {&lt;br /&gt;
            num--;&lt;br /&gt;
            &lt;br /&gt;
            for (new j=i;j&amp;lt;num;j++)&lt;br /&gt;
            {&lt;br /&gt;
                players[j] = players[j+1]&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            i--&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return 1&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Functions ==&lt;br /&gt;
=== EngFunc_PrecacheModel ===&lt;br /&gt;
Precaches a model or sprite file.&lt;br /&gt;
&lt;br /&gt;
This should be used only when you would need to postpone the precache process in plugin_init() or plugin_cfg(), otherwise you should use precache_model() native directly in plugin_precache() forward.&lt;br /&gt;
&lt;br /&gt;
It can be useful for example when you want to manage models with cvars and to avoid registering them in plugin_precache() then getting some trouble, you could manage out of this forward.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;sprites/MySprite.spr&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
It returns the precached model/sprite index if successful, otherwise 0.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_PrecacheSound ===&lt;br /&gt;
Precaches a sound, only *.wav file. ( for mp3, see EngFunc_PrecacheGeneric )&lt;br /&gt;
&lt;br /&gt;
This should be used only when you would need to postpone the precache process in plugin_init() or plugin_cfg(), otherwise you should use precache_sound() native directly in plugin_precache() forward.&lt;br /&gt;
&lt;br /&gt;
It can be useful for example when you want to manage sounds with cvars and to avoid registering them in plugin_precache() then getting some trouble, you could manage out of this forward.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheSound, &amp;quot;sound/MySound.wav&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
It returns the precached sound index if successful, otherwise 0.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AlertMessage ===&lt;br /&gt;
Prints an alert message.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_AlertMessage, AlertType, const Message)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
AlertType can be:&lt;br /&gt;
&lt;br /&gt;
 at_notice - shows a message box with the message&lt;br /&gt;
 at_console - same as at_notice, but forces a ConPrintf, not a message box, prints output to server console, but only if 'developer' is 1.&lt;br /&gt;
 at_aiconsole - same as at_console, but only shown if 'developer' is 2.&lt;br /&gt;
 at_warning -&lt;br /&gt;
 at_error -&lt;br /&gt;
 at_logged - prints output to server logs and console.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7843</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7843"/>
		<updated>2010-09-07T16:42:52Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_PrecacheSound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_MoveToOrigin ===&lt;br /&gt;
Moves an entity a defined distance toward a coordinate.&lt;br /&gt;
&lt;br /&gt;
If the distance between Entity and Destination is less than the required distance, the entity will pass over that point.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MoveToOrigin, iEnt, Float:Destination[3], Float:Distance, iMoveType)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Destination[3] = A Coordinate toward which the entity moves&lt;br /&gt;
* Distance = The distance to move the entity&lt;br /&gt;
* iMoveType = This is the MOVE_* option used for monsters and players to change the behaviour of the movement&lt;br /&gt;
&lt;br /&gt;
Move type possible values:&lt;br /&gt;
&lt;br /&gt;
 #define MOVE_NORMAL		0	// normal move in the direction monster is facing&lt;br /&gt;
 #define MOVE_STRAFE		1	// moves in direction specified, no matter which way monster is facing&lt;br /&gt;
 #define MOVE_STUCK_DIST		32	// if a monster can't step this far, it is stuck.&lt;br /&gt;
 #define MOVE_START_TURN_DIST	64	// when this far away from moveGoal, start turning to face next goal&lt;br /&gt;
&lt;br /&gt;
==== Caveats ====&lt;br /&gt;
&lt;br /&gt;
* iEnt must be on ground&lt;br /&gt;
* If there's an object closer than Distance that iEnt could collide then the movement is not done&lt;br /&gt;
* If there's a ramp, it works like an object and the movement is not done&lt;br /&gt;
&lt;br /&gt;
== Visibility Functions ==&lt;br /&gt;
=== EngFunc_CheckVisibility ===&lt;br /&gt;
This function is used to check if an entity is in your [[PVS]].&lt;br /&gt;
&lt;br /&gt;
'''It can be used on all entities except worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
This function has a parameter that must be obtained in a special way, the ''pset'' parameter.&lt;br /&gt;
'''Note:''' The parameter is player only, that means that if you get pset for example for a player that has the id ''1''. When you use this function on an entity it will check whether that entity is in [[PVS]] of the Player id ''1''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new g_cl_pset[33]&lt;br /&gt;
&lt;br /&gt;
public plugin_init(id)&lt;br /&gt;
{&lt;br /&gt;
    register_forward(FM_AddToFullPack, &amp;quot;pfw_atfp&amp;quot;, 1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public pfw_atfp(es, e, ent, host, flags, player, set)&lt;br /&gt;
{&lt;br /&gt;
    g_cl_pset[host] = set&lt;br /&gt;
    &lt;br /&gt;
    return FMRES_IGNORED&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock is_ent_in_player_pvs(id, entity)&lt;br /&gt;
{&lt;br /&gt;
    return engfunc(EngFunc_CheckVisibility, entity, g_cl_pset[id])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock get_pvs_players(id, players[32], num, flags[], team[])&lt;br /&gt;
{&lt;br /&gt;
    if (!is_user_connected(id))&lt;br /&gt;
        return 0    &lt;br /&gt;
&lt;br /&gt;
    get_players(players, num, flags, team)&lt;br /&gt;
    &lt;br /&gt;
    for (new i=0;i&amp;lt;num;i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (!is_ent_in_player_pvs(id, players[i]))&lt;br /&gt;
        {&lt;br /&gt;
            num--;&lt;br /&gt;
            &lt;br /&gt;
            for (new j=i;j&amp;lt;num;j++)&lt;br /&gt;
            {&lt;br /&gt;
                players[j] = players[j+1]&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            i--&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return 1&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Functions ==&lt;br /&gt;
=== EngFunc_PrecacheModel ===&lt;br /&gt;
Precaches a model or sprite file.&lt;br /&gt;
&lt;br /&gt;
This should be used only when you would need to postpone the precache process in plugin_init() or plugin_cfg(), otherwise you should use precache_model() native directly in plugin_precache() forward.&lt;br /&gt;
&lt;br /&gt;
It can be useful for example when you want to manage models with cvars and to avoid registering them in plugin_precache() then getting some trouble, you could manage out of this forward.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;sprites/MySprite.spr&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
It returns the precached model/sprite index if successful, otherwise 0.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_PrecacheSound ===&lt;br /&gt;
Precaches a sound, only *.wav file. ( for mp3, see EngFunc_PrecacheGeneric )&lt;br /&gt;
&lt;br /&gt;
This should be used only when you would need to postpone the precache process in plugin_init() or plugin_cfg(), otherwise you should use precache_sound() native directly in plugin_precache() forward.&lt;br /&gt;
&lt;br /&gt;
It can be useful for example when you want to manage sounds with cvars and to avoid registering them in plugin_precache() then getting some trouble, you could manage out of this forward.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheSound, &amp;quot;sound/MySound.wav&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
It returns the precached sound index if successful, otherwise 0.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7842</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7842"/>
		<updated>2010-09-07T16:41:29Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_PrecacheModel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_MoveToOrigin ===&lt;br /&gt;
Moves an entity a defined distance toward a coordinate.&lt;br /&gt;
&lt;br /&gt;
If the distance between Entity and Destination is less than the required distance, the entity will pass over that point.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MoveToOrigin, iEnt, Float:Destination[3], Float:Distance, iMoveType)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Destination[3] = A Coordinate toward which the entity moves&lt;br /&gt;
* Distance = The distance to move the entity&lt;br /&gt;
* iMoveType = This is the MOVE_* option used for monsters and players to change the behaviour of the movement&lt;br /&gt;
&lt;br /&gt;
Move type possible values:&lt;br /&gt;
&lt;br /&gt;
 #define MOVE_NORMAL		0	// normal move in the direction monster is facing&lt;br /&gt;
 #define MOVE_STRAFE		1	// moves in direction specified, no matter which way monster is facing&lt;br /&gt;
 #define MOVE_STUCK_DIST		32	// if a monster can't step this far, it is stuck.&lt;br /&gt;
 #define MOVE_START_TURN_DIST	64	// when this far away from moveGoal, start turning to face next goal&lt;br /&gt;
&lt;br /&gt;
==== Caveats ====&lt;br /&gt;
&lt;br /&gt;
* iEnt must be on ground&lt;br /&gt;
* If there's an object closer than Distance that iEnt could collide then the movement is not done&lt;br /&gt;
* If there's a ramp, it works like an object and the movement is not done&lt;br /&gt;
&lt;br /&gt;
== Visibility Functions ==&lt;br /&gt;
=== EngFunc_CheckVisibility ===&lt;br /&gt;
This function is used to check if an entity is in your [[PVS]].&lt;br /&gt;
&lt;br /&gt;
'''It can be used on all entities except worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
This function has a parameter that must be obtained in a special way, the ''pset'' parameter.&lt;br /&gt;
'''Note:''' The parameter is player only, that means that if you get pset for example for a player that has the id ''1''. When you use this function on an entity it will check whether that entity is in [[PVS]] of the Player id ''1''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new g_cl_pset[33]&lt;br /&gt;
&lt;br /&gt;
public plugin_init(id)&lt;br /&gt;
{&lt;br /&gt;
    register_forward(FM_AddToFullPack, &amp;quot;pfw_atfp&amp;quot;, 1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public pfw_atfp(es, e, ent, host, flags, player, set)&lt;br /&gt;
{&lt;br /&gt;
    g_cl_pset[host] = set&lt;br /&gt;
    &lt;br /&gt;
    return FMRES_IGNORED&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock is_ent_in_player_pvs(id, entity)&lt;br /&gt;
{&lt;br /&gt;
    return engfunc(EngFunc_CheckVisibility, entity, g_cl_pset[id])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock get_pvs_players(id, players[32], num, flags[], team[])&lt;br /&gt;
{&lt;br /&gt;
    if (!is_user_connected(id))&lt;br /&gt;
        return 0    &lt;br /&gt;
&lt;br /&gt;
    get_players(players, num, flags, team)&lt;br /&gt;
    &lt;br /&gt;
    for (new i=0;i&amp;lt;num;i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (!is_ent_in_player_pvs(id, players[i]))&lt;br /&gt;
        {&lt;br /&gt;
            num--;&lt;br /&gt;
            &lt;br /&gt;
            for (new j=i;j&amp;lt;num;j++)&lt;br /&gt;
            {&lt;br /&gt;
                players[j] = players[j+1]&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            i--&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return 1&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other Functions ==&lt;br /&gt;
=== EngFunc_PrecacheModel ===&lt;br /&gt;
Precaches a model or sprite file.&lt;br /&gt;
&lt;br /&gt;
This should be used only when you would need to postpone the precache process in plugin_init() or plugin_cfg(), otherwise you should use precache_model() native directly in plugin_precache() forward.&lt;br /&gt;
&lt;br /&gt;
It can be useful for example when you want to manage models with cvars and to avoid registering them in plugin_precache() then getting some trouble, you could manage out of this forward.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_PrecacheModel, &amp;quot;sprites/MySprite.spr&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
It returns the precached model/sprite index if successful, otherwise 0.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7841</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7841"/>
		<updated>2010-09-07T16:39:20Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_CheckVisibility&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_MoveToOrigin ===&lt;br /&gt;
Moves an entity a defined distance toward a coordinate.&lt;br /&gt;
&lt;br /&gt;
If the distance between Entity and Destination is less than the required distance, the entity will pass over that point.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MoveToOrigin, iEnt, Float:Destination[3], Float:Distance, iMoveType)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Destination[3] = A Coordinate toward which the entity moves&lt;br /&gt;
* Distance = The distance to move the entity&lt;br /&gt;
* iMoveType = This is the MOVE_* option used for monsters and players to change the behaviour of the movement&lt;br /&gt;
&lt;br /&gt;
Move type possible values:&lt;br /&gt;
&lt;br /&gt;
 #define MOVE_NORMAL		0	// normal move in the direction monster is facing&lt;br /&gt;
 #define MOVE_STRAFE		1	// moves in direction specified, no matter which way monster is facing&lt;br /&gt;
 #define MOVE_STUCK_DIST		32	// if a monster can't step this far, it is stuck.&lt;br /&gt;
 #define MOVE_START_TURN_DIST	64	// when this far away from moveGoal, start turning to face next goal&lt;br /&gt;
&lt;br /&gt;
==== Caveats ====&lt;br /&gt;
&lt;br /&gt;
* iEnt must be on ground&lt;br /&gt;
* If there's an object closer than Distance that iEnt could collide then the movement is not done&lt;br /&gt;
* If there's a ramp, it works like an object and the movement is not done&lt;br /&gt;
&lt;br /&gt;
== Visibility Functions ==&lt;br /&gt;
=== EngFunc_CheckVisibility ===&lt;br /&gt;
This function is used to check if an entity is in your [[PVS]].&lt;br /&gt;
&lt;br /&gt;
'''It can be used on all entities except worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
This function has a parameter that must be obtained in a special way, the ''pset'' parameter.&lt;br /&gt;
'''Note:''' The parameter is player only, that means that if you get pset for example for a player that has the id ''1''. When you use this function on an entity it will check whether that entity is in [[PVS]] of the Player id ''1''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new g_cl_pset[33]&lt;br /&gt;
&lt;br /&gt;
public plugin_init(id)&lt;br /&gt;
{&lt;br /&gt;
    register_forward(FM_AddToFullPack, &amp;quot;pfw_atfp&amp;quot;, 1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public pfw_atfp(es, e, ent, host, flags, player, set)&lt;br /&gt;
{&lt;br /&gt;
    g_cl_pset[host] = set&lt;br /&gt;
    &lt;br /&gt;
    return FMRES_IGNORED&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock is_ent_in_player_pvs(id, entity)&lt;br /&gt;
{&lt;br /&gt;
    return engfunc(EngFunc_CheckVisibility, entity, g_cl_pset[id])&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stock get_pvs_players(id, players[32], num, flags[], team[])&lt;br /&gt;
{&lt;br /&gt;
    if (!is_user_connected(id))&lt;br /&gt;
        return 0    &lt;br /&gt;
&lt;br /&gt;
    get_players(players, num, flags, team)&lt;br /&gt;
    &lt;br /&gt;
    for (new i=0;i&amp;lt;num;i++)&lt;br /&gt;
    {&lt;br /&gt;
        if (!is_ent_in_player_pvs(id, players[i]))&lt;br /&gt;
        {&lt;br /&gt;
            num--;&lt;br /&gt;
            &lt;br /&gt;
            for (new j=i;j&amp;lt;num;j++)&lt;br /&gt;
            {&lt;br /&gt;
                players[j] = players[j+1]&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            i--&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return 1&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7840</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7840"/>
		<updated>2010-09-07T16:33:52Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_MoveToOrigin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_MoveToOrigin ===&lt;br /&gt;
Moves an entity a defined distance toward a coordinate.&lt;br /&gt;
&lt;br /&gt;
If the distance between Entity and Destination is less than the required distance, the entity will pass over that point.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MoveToOrigin, iEnt, Float:Destination[3], Float:Distance, iMoveType)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Destination[3] = A Coordinate toward which the entity moves&lt;br /&gt;
* Distance = The distance to move the entity&lt;br /&gt;
* iMoveType = This is the MOVE_* option used for monsters and players to change the behaviour of the movement&lt;br /&gt;
&lt;br /&gt;
Move type possible values:&lt;br /&gt;
&lt;br /&gt;
 #define MOVE_NORMAL		0	// normal move in the direction monster is facing&lt;br /&gt;
 #define MOVE_STRAFE		1	// moves in direction specified, no matter which way monster is facing&lt;br /&gt;
 #define MOVE_STUCK_DIST		32	// if a monster can't step this far, it is stuck.&lt;br /&gt;
 #define MOVE_START_TURN_DIST	64	// when this far away from moveGoal, start turning to face next goal&lt;br /&gt;
&lt;br /&gt;
==== Caveats ====&lt;br /&gt;
&lt;br /&gt;
* iEnt must be on ground&lt;br /&gt;
* If there's an object closer than Distance that iEnt could collide then the movement is not done&lt;br /&gt;
* If there's a ramp, it works like an object and the movement is not done&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7839</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7839"/>
		<updated>2010-09-07T16:31:12Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_SetOrigin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetOrigin ===&lt;br /&gt;
Properly sets a new origin on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetOrigin, iEnt, Float:Origin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* Origin[3] = New origin for the entity (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_origin(index, Float:NewOrigin[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=353 FuncWiki page for entity_set_origin]]&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7838</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7838"/>
		<updated>2010-09-07T16:29:19Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_SetSize&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_SetSize ===&lt;br /&gt;
Sets the bounds of an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetSize, iEnt, Float:fMins[3], Float:fMaxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* fMins[3] = Mins boundings values (x,y,z)&lt;br /&gt;
* fMaxs[3] = Maxs boundings values (x,y,z)&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_size(index, Float:mins[3], Float:maxs[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=328 FuncWiki page for entity_set_size]]&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7837</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7837"/>
		<updated>2010-09-07T16:27:05Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_NumberOfEntities&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;br /&gt;
&lt;br /&gt;
== Entity/Global Functions ==&lt;br /&gt;
=== EngFunc_NumberOfEntities ===&lt;br /&gt;
Returns the number of entities in the world.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = engfunc(EngFunc_NumberOfEntities)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Engine alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ents = entity_count()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=356 FuncWiki page for entity_count]]&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7836</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7836"/>
		<updated>2010-09-07T16:25:04Z</updated>

		<summary type="html">&lt;p&gt;Seta00: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_AnimationAutomove ===&lt;br /&gt;
Plays the selected animation on entity&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_float(iEnt, EV_FL_framerate, fFrameRate);&lt;br /&gt;
entity_set_int(iEnt, EV_INT_sequence, iSequence);&lt;br /&gt;
engfunc(EngFunc_AnimationAutomove, iEnt, fTime);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* fFrameRate = Frame rate of desired animation.&lt;br /&gt;
* iSequence = Sequence to play.&lt;br /&gt;
* iEnt = Source entity.&lt;br /&gt;
* fTime = '''It seems to not affect the animation. Maybe for internal use.'''&lt;br /&gt;
&lt;br /&gt;
First you have to select the sequence and the desired frame rate. Then you can start the animation.&lt;br /&gt;
It will run in an endless loop.&lt;br /&gt;
&lt;br /&gt;
It seems to work only on non-player entities.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7835</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7835"/>
		<updated>2010-09-07T16:23:11Z</updated>

		<summary type="html">&lt;p&gt;Seta00: /* Engine Alternative */ fixed link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
[[http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354 FuncWiki page for entity_set_model]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7834</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7834"/>
		<updated>2010-09-07T16:22:23Z</updated>

		<summary type="html">&lt;p&gt;Seta00: /* Extra Info */ Fixed links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?p=850698 TraceModel example]]&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine|TraceLine explanation]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7833</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7833"/>
		<updated>2010-09-07T16:21:40Z</updated>

		<summary type="html">&lt;p&gt;Seta00: /* Extra Info */ Fixed links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
[[http://developer.valvesoftware.com/wiki/TraceLines Description of tracelines on the Valve Developer Community]]&lt;br /&gt;
&lt;br /&gt;
[[http://forums.alliedmods.net/showthread.php?t=66076 Traceline tutorial by Nomexous]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7832</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7832"/>
		<updated>2010-09-07T16:20:07Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Fixed links in EntitiesInPVS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS|EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS|EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility|CheckVisibility]] and [[#EngFunc_EntitiesInPVS|EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7831</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7831"/>
		<updated>2010-09-07T16:18:26Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_DecalIndex&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex|EngFunc_ModelIndex]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_DecalIndex ===&lt;br /&gt;
Returns an unique index of the decal name provided.&lt;br /&gt;
&lt;br /&gt;
A decal index is used for example in some TE_* messages. ( TE_PLAYERDECAL, TE_DECAL, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
All the available decals are stored in the decals.wad file. ( Located at your mod root directory )&lt;br /&gt;
&lt;br /&gt;
As side-note a plugin [[http://forums.alliedmods.net/showthread.php?p=247677 &amp;quot;Decals/Models Lister&amp;quot;]] is available to see a list of decals/models index/name. ( Only CS and HL )&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;DecalIndex = engfunc(EngFunc_DecalIndex, &amp;quot;{bigshot1&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
DecalIndex will have the decal index for &amp;quot;{bigshot1&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7830</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7830"/>
		<updated>2010-09-07T16:13:31Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_ModelFrames&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelFrames ===&lt;br /&gt;
Returns the frames count of a model.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelFrames = engfunc(EngFunc_ModelFrames, ModelIndex)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ModelIndex = The model index. Value you can get from precache_model() or [[#EngFunc_ModelIndex]].&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7829</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7829"/>
		<updated>2010-09-07T16:11:55Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_ModelIndex&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_ModelIndex ===&lt;br /&gt;
Returns an unique index of the model name provided.&lt;br /&gt;
It's actually the same number that precache_model() returns.&lt;br /&gt;
&lt;br /&gt;
A model index is used for example in some TE_* messages. ( TE_LIGHTNING, TE_GLOWSPRITE, etc.. See message_const.inc file ).&lt;br /&gt;
&lt;br /&gt;
The model index of an entity is stored in pev_modelindex.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;ModelIndex = engfunc(EngFunc_ModelIndex, &amp;quot;models/MyModel.mdl&amp;quot;)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
ModelIndex will have the model index for &amp;quot;models/MyModel.mdl&amp;quot; after the function call.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7828</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7828"/>
		<updated>2010-09-07T16:09:58Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_SetModel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;br /&gt;
&lt;br /&gt;
== Model/Decal/Texture Functions ==&lt;br /&gt;
=== EngFunc_SetModel ===&lt;br /&gt;
Properly sets a new model on an entity.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_SetModel, iEnt, sModel)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* iEnt = Entity index&lt;br /&gt;
* sModel = Model file name to set on entity (ex: &amp;quot;models/player/vip/vip.mdl&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==== Engine Alternative ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;entity_set_model(entity, model[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
http://www.amxmodx.org/funcwiki.php?go=func&amp;amp;id=354&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7827</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7827"/>
		<updated>2010-09-07T16:07:37Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_TraceToss&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceToss ===&lt;br /&gt;
Trace the point where some entity movement will finish.&lt;br /&gt;
If for some reason the entity movement must be blocked for other entity (or worldspawn), TraceToss will detect that situation taking in account the original entity bounding boxes.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceToss, ent, skipent, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent = The entity which movement we want to trace&lt;br /&gt;
* skipent = The entity to skip in trace&lt;br /&gt;
* tr = trace handle to store the result&lt;br /&gt;
&lt;br /&gt;
[[Image:Tracetoss.jpg|thumb|EngFunc_TraceToss example]]&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
In the image you can see a player jumping and 2 points.&lt;br /&gt;
&lt;br /&gt;
''Start Point'' is the origin of the player when TraceToss was called.&lt;br /&gt;
&lt;br /&gt;
''End Point'' is the point returned in TR result.&lt;br /&gt;
&lt;br /&gt;
So the player is making a parabola from START to END.&lt;br /&gt;
The green line is only for testing purposes and show from where to where the trace is.&lt;br /&gt;
This was tested with gravity = 400.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:Tracetoss.jpg&amp;diff=7826</id>
		<title>File:Tracetoss.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:Tracetoss.jpg&amp;diff=7826"/>
		<updated>2010-09-07T16:05:27Z</updated>

		<summary type="html">&lt;p&gt;Seta00: EngFunc_TraceToss example.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;EngFunc_TraceToss example.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7825</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7825"/>
		<updated>2010-09-07T16:03:06Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added EngFunc_TraceModel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceTexture, DLLFunc_PM_FindTextureType ===&lt;br /&gt;
The TraceTexture function detects the texture of an entity from a direction&lt;br /&gt;
&lt;br /&gt;
The FindTextureType function allows to get the type of the material of the texture.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceTexture, ent, Float:start[3], Float:end[3], texture_name, len)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* ent is the entity that we want to get the texture&lt;br /&gt;
* start is the point from where the trace starts&lt;br /&gt;
* end is the point where the trace ends&lt;br /&gt;
* texture_name - here we save the texture name&lt;br /&gt;
* len - the texture_name string length&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* texture_name is the name of the texture that we have gotten with TraceTexture&lt;br /&gt;
&lt;br /&gt;
The function returns the material of the texture, which can be one of the following:&lt;br /&gt;
&lt;br /&gt;
* C : concrete        &lt;br /&gt;
* D : dirt    &lt;br /&gt;
* G : grate     &lt;br /&gt;
* M : metal &lt;br /&gt;
* N : snow&lt;br /&gt;
* P : computer    &lt;br /&gt;
* S : slosh     &lt;br /&gt;
* T : tile     &lt;br /&gt;
* V : ventilation          &lt;br /&gt;
* W : wood        &lt;br /&gt;
* Y : glass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;new texture_name[64], texture_type&lt;br /&gt;
    engfunc(EngFunc_TraceTexture, 0, start, end, texture_name, charsmax(texture_name))&lt;br /&gt;
    texture_type = dllfunc(DLLFunc_PM_FindTextureType, texture_name)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
'''Improper use of these functions may crash the server!'''&lt;br /&gt;
&lt;br /&gt;
To avoid crashing the server use the TraceTexture:&lt;br /&gt;
* on any entities (even worldspawn) except players&lt;br /&gt;
* when there is at least one player connected&lt;br /&gt;
* with a big distance between the two points (&amp;gt; 2000.0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_TraceModel ===&lt;br /&gt;
This function traces between 2 origins a model and gives us properties about it.&lt;br /&gt;
It acts just like a TraceLine but it ignores all the entities except the one we want to hit!&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceModel, const Float:start[3], const Float:end[3], hull, ent_to_hit, ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
* start - start origin&lt;br /&gt;
* end - end origin&lt;br /&gt;
* hull - the hull that is moved check above to see them&lt;br /&gt;
* ent_to_hit - the entity that you want to hit (this is a must!)&lt;br /&gt;
* ptr - the trace handle pointer, acts the same as the one in trace line!&lt;br /&gt;
&lt;br /&gt;
The constants that we can use in hull:&lt;br /&gt;
&lt;br /&gt;
 #define HULL_POINT                      0  // This means that we are moving a point from the start to the end&lt;br /&gt;
 #define HULL_HUMAN                      1  // That means that we move a cube of a player from start to end&lt;br /&gt;
 #define HULL_LARGE                      2  // That means that we move a bigger cube that one of the player from start to end&lt;br /&gt;
                                            // (used in HL for big monsters!)&lt;br /&gt;
 #define HULL_HEAD                       3  // This means that we move from start to end the hull of a ducked player&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
TraceModel example: http://forums.alliedmods.net/showthread.php?p=850698&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_TraceLine]] explanation.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7824</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7824"/>
		<updated>2010-09-07T15:24:12Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Added category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting (AMX Mod X)]]&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7823</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7823"/>
		<updated>2010-09-07T15:22:06Z</updated>

		<summary type="html">&lt;p&gt;Seta00: fixed links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7822</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7822"/>
		<updated>2010-09-07T15:21:39Z</updated>

		<summary type="html">&lt;p&gt;Seta00: TraceLine&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;br /&gt;
&lt;br /&gt;
== Trace Functions ==&lt;br /&gt;
=== EngFunc_TraceLine ===&lt;br /&gt;
This function traces between 2 origins and gives us information about it.&lt;br /&gt;
&lt;br /&gt;
These are the constants we can use as flags:&lt;br /&gt;
&lt;br /&gt;
 #define DONT_IGNORE_MONSTERS            0&lt;br /&gt;
 #define IGNORE_MONSTERS                 1&lt;br /&gt;
 #define IGNORE_MISSILE                  2&lt;br /&gt;
 #define IGNORE_GLASS                    0x100&lt;br /&gt;
&lt;br /&gt;
'''These constants can be used together.'''&lt;br /&gt;
&lt;br /&gt;
Ex: IGNORE_MISSILE | IGNORE_MONSTERS | IGNORE_GLASS - This makes the traceline ignore missiles, monsters (players) and glass.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Example of doing a traceline between two origins, and ignoring glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering glass:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Traceline1.jpg|Traceline result if glass is ignored. The entity is ignored because of its solid flag&lt;br /&gt;
File:Traceline2.jpg|Traceline result if glass is not ignored.&lt;br /&gt;
File:Traceline3.jpg|Traceline result if glass is ignored but there's an entity with blocking solid flags in the way&lt;br /&gt;
File:Traceline4.jpg|Traceline result if glass is ignored, and the entity in the way has non-blocking flags&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Other Traceline functions ====&lt;br /&gt;
This creates a trace handle. It's important to do this because we don't want our plugins to mess with eachothers info.&lt;br /&gt;
&amp;lt;pawn&amp;gt;new ptr = create_tr2()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this frees the trace handle:&lt;br /&gt;
&amp;lt;pawn&amp;gt;free_tr2(ptr)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Getter and setter:&lt;br /&gt;
&amp;lt;pawn&amp;gt;[g|s]et_tr2(trace_handle, CONSTANT, argument_if_setting)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where CONSTANT can be one of the following enumerations:&lt;br /&gt;
&amp;lt;pawn&amp;gt;enum TraceResult&lt;br /&gt;
{&lt;br /&gt;
	TR_AllSolid,		// int&lt;br /&gt;
	TR_StartSolid,		// int&lt;br /&gt;
	TR_InOpen,		// int&lt;br /&gt;
	TR_InWater,		// int&lt;br /&gt;
	TR_flFraction,		// float&lt;br /&gt;
	TR_vecEndPos,		// float array[3]&lt;br /&gt;
	TR_flPlaneDist,		// float&lt;br /&gt;
	TR_vecPlaneNormal,	// float array[3]&lt;br /&gt;
	TR_pHit,		// int (edict_t*)&lt;br /&gt;
	TR_iHitgroup,		// int&lt;br /&gt;
};&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Getting the array and Float values require the third parameter to be passed.'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;&lt;br /&gt;
    new startsolid = get_tr2(trace, TR_StartSolid)&lt;br /&gt;
    // TR_StartSolid is a boolean that says whether you were &amp;quot;inside&amp;quot; something &lt;br /&gt;
    // (usually the world) when the trace started (point A)&lt;br /&gt;
    // TR_AllSolid tells you if you ever got out of the &amp;quot;inside&amp;quot; or not.&lt;br /&gt;
    &lt;br /&gt;
    new inopen = get_tr2(trace, TR_InOpen)&lt;br /&gt;
    // TR_InOpen means that the start point is in Open&lt;br /&gt;
    // That means in the world and not in an ent or something&lt;br /&gt;
    &lt;br /&gt;
    new hit = get_tr2(trace, TR_pHit)&lt;br /&gt;
    // What was hit by the traceline. It will either be a player index,&lt;br /&gt;
    // entity index, 0 (part of map), or -1 (didn't hit anything; &lt;br /&gt;
    // doesn't happen with player tracelines).&lt;br /&gt;
    &lt;br /&gt;
    new hitgroup = get_tr2(trace, TR_iHitgroup)&lt;br /&gt;
    // If the traceline hit another player, returns will be HIT_HEAD,&lt;br /&gt;
    // HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the&lt;br /&gt;
    // map, this returns HIT_GENERIC.&lt;br /&gt;
    &lt;br /&gt;
    new Float:fraction&lt;br /&gt;
    get_tr2(trace, TR_flFraction, fraction)&lt;br /&gt;
    // Returns a number between 0.0 and 1.0, indicating how far the&lt;br /&gt;
    // traceline traveled start to end before it hit something. Depending&lt;br /&gt;
    // on what conditions were passed to this traceline forward function,&lt;br /&gt;
    // it could either be a wall or another entity.&lt;br /&gt;
    &lt;br /&gt;
    new Float:end_origin[3]&lt;br /&gt;
    get_tr2(trace, TR_vecEndPos, end_origin)&lt;br /&gt;
    // The official end of the traceline. Not necesarily the same as the&lt;br /&gt;
    // second argument passed to this traceline forward function.&lt;br /&gt;
    &lt;br /&gt;
    new Float:normal[3]&lt;br /&gt;
    get_tr2(trace, TR_vecPlaneNormal, normal)&lt;br /&gt;
    // Returns a 1 unit long vector normal to the spot that it hit. Note&lt;br /&gt;
    // that &amp;quot;normal&amp;quot; has a special connotation here. It doesn't mean &amp;quot;regular.&amp;quot;&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
===== is_wall_between_points =====&lt;br /&gt;
This returns true if there's a wall between ''start'' and ''end''.&lt;br /&gt;
&amp;lt;pawn&amp;gt;stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)&lt;br /&gt;
{&lt;br /&gt;
    // Create the trace handle! It is best to create it!&lt;br /&gt;
    new ptr = create_tr2()&lt;br /&gt;
    &lt;br /&gt;
    // The main traceline function!&lt;br /&gt;
    // This function ignores GLASS, MISSILE and MONSTERS!&lt;br /&gt;
    // Here is an example of how you should combine all the flags!&lt;br /&gt;
    engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)&lt;br /&gt;
    &lt;br /&gt;
    // We are interested in the fraction parameter&lt;br /&gt;
    new fraction&lt;br /&gt;
    get_tr2(ptr, TR_flFraction, fraction)&lt;br /&gt;
    &lt;br /&gt;
    // Free the trace handle (don't forget to do this!)&lt;br /&gt;
    free_tr2(ptr)&lt;br /&gt;
    &lt;br /&gt;
    // If = 1.0 then it didn't hit anything!&lt;br /&gt;
    return (fraction != 1.0)&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Extra Info ====&lt;br /&gt;
http://developer.valvesoftware.com/wiki/TraceLines&lt;br /&gt;
http://forums.alliedmods.net/showthread.php?t=66076&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:Traceline4.jpg&amp;diff=7821</id>
		<title>File:Traceline4.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:Traceline4.jpg&amp;diff=7821"/>
		<updated>2010-09-07T14:46:09Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Traceline result from point to point.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traceline result from point to point.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:Traceline3.jpg&amp;diff=7820</id>
		<title>File:Traceline3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:Traceline3.jpg&amp;diff=7820"/>
		<updated>2010-09-07T14:45:40Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Traceline result if glass is ignored, with an blocking entity in its way.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traceline result if glass is ignored, with an blocking entity in its way.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:Traceline2.jpg&amp;diff=7819</id>
		<title>File:Traceline2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:Traceline2.jpg&amp;diff=7819"/>
		<updated>2010-09-07T14:45:03Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Traceline result if glass is not ignored.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traceline result if glass is not ignored.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:Traceline1.jpg&amp;diff=7818</id>
		<title>File:Traceline1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:Traceline1.jpg&amp;diff=7818"/>
		<updated>2010-09-07T14:44:31Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Traceline result if glass is ignored.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Traceline result if glass is ignored.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7817</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7817"/>
		<updated>2010-09-07T05:31:05Z</updated>

		<summary type="html">&lt;p&gt;Seta00: typo on EntitiesInPVS name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_EntitiesInPVS]].&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_EntitiesInPVS]] are better functions to use.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7816</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7816"/>
		<updated>2010-09-07T05:30:06Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Entity Search Functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;br /&gt;
&lt;br /&gt;
== Entity Search Functions ==&lt;br /&gt;
=== EngFunc_FindEntityInSphere ===&lt;br /&gt;
Find entities within a radius. '''The function returns the next entity id after the start entity.'''&lt;br /&gt;
&lt;br /&gt;
[[Image:FindEntityInSphere.png|thumb|3D diagram to show how the function works.]]&lt;br /&gt;
If we use&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, -1, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
In the situation described on the picture the function call above will return 1,&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 20, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 30 and&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, 100, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
will return 0, meaning that it didn't find an entity with an id grater than 100.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_FindEntityInSphere, ent_to_start, origin, radius)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_EntitiesInPVS ===&lt;br /&gt;
&lt;br /&gt;
This function checks entities that are in the [[PVS]] of an entity.&lt;br /&gt;
'''It can't be used on worldspawn.'''&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity on the [[PVS]] and then you can traverse through the results using pev_chain/EV_ENT_chain.&lt;br /&gt;
A NULL value of pev_chain/EV_ENT_chain indicates the end of the chain.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;public whatisonPVS(id)&lt;br /&gt;
{&lt;br /&gt;
    static next, chain&lt;br /&gt;
    static class[32]&lt;br /&gt;
    &lt;br /&gt;
    next = engfunc(EngFunc_EntitiesInPVS, id)&lt;br /&gt;
    while(next)&lt;br /&gt;
    {&lt;br /&gt;
        pev(next, pev_classname, class, charsmax(class))&lt;br /&gt;
        chain = pev(next, pev_chain)&lt;br /&gt;
        &lt;br /&gt;
        server_print(&amp;quot;Found entity in player (%i) PVS: ent(%i) class(%s)&amp;quot;, id, next, class)&lt;br /&gt;
        &lt;br /&gt;
        if(!chain)&lt;br /&gt;
            break&lt;br /&gt;
    &lt;br /&gt;
        next = chain&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindEntityByString ===&lt;br /&gt;
Returns the first entity found that matches the search criteria.&lt;br /&gt;
&lt;br /&gt;
You can use any of string type attributes of entities:&lt;br /&gt;
&lt;br /&gt;
 classname	Type of entity&lt;br /&gt;
 globalname	This is the name of the global variable that can be used to control the state of the entity&lt;br /&gt;
 model	 	The model of the entity&lt;br /&gt;
 target	 	Entity that this entity is handling&lt;br /&gt;
 targetname	The name given to this entity that another entity searches for to handle it&lt;br /&gt;
 netname		Player or NPC name&lt;br /&gt;
 message		Seems to be used mainly to store sound (string). It happens to store others things, depending the need of the entity&lt;br /&gt;
 noise		Noise variables do different things for different ents&lt;br /&gt;
 noise1		This is the move sound for doors&lt;br /&gt;
 noise2		This is the stop sound for doors&lt;br /&gt;
 noise3		This is for blocking game_player_equip and player_weaponstrip&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt = engfunc(EngFunc_FindEntityByString, iStartEnt, sAttribute, sValue)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iStartEnt: Start searching on this entity (ex: 0 = worldspawn)&lt;br /&gt;
* sAttribute: Name of attribute over which we need to search (ex: classname)&lt;br /&gt;
* sValue: Text string that we are searching for (ex: func_breakable)&lt;br /&gt;
&lt;br /&gt;
The function returns the first entity matching the criteria.&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_FindClientInPVS ===&lt;br /&gt;
Returns the next &amp;quot;player&amp;quot; entity in someone's [[PVS]] using a global loop.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;iEnt2 = engfunc(EngFunc_FindClientInPVS, iEnt)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Parameters:&lt;br /&gt;
* iEnt		Source entity. Seek someone within iEnt's [[PVS]]&lt;br /&gt;
&lt;br /&gt;
Unlike [[#EngFunc_EntitiesInPVS]], it does not return a series of chained entities. Instead, it works like a global loop of entities.&lt;br /&gt;
No matter which source entity you use, this function maintains the last index used and returns the next entity in source entity [[PVS]].&lt;br /&gt;
&lt;br /&gt;
This function must be called several times to find every entity in [[PVS]] and can also return the source entity but it can't be called twice inside the same function because it will return the same entity.&lt;br /&gt;
&lt;br /&gt;
==== Notes ====&lt;br /&gt;
It's not clear the main purpose of this function because you can get similar results with [[#EngFunc_FindEntitiesInPVS]].&lt;br /&gt;
[[#EngFunc_CheckVisibility]] and [[#EngFunc_FindEntitiesInPVS]] are better functions to use.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:FindEntityInSphere.png&amp;diff=7815</id>
		<title>File:FindEntityInSphere.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:FindEntityInSphere.png&amp;diff=7815"/>
		<updated>2010-09-07T05:03:48Z</updated>

		<summary type="html">&lt;p&gt;Seta00: 3D diagram to show how EngFunc_FindEntityInSphere works.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;3D diagram to show how EngFunc_FindEntityInSphere works.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7814</id>
		<title>FakeMeta Functions Detailed Descriptions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=FakeMeta_Functions_Detailed_Descriptions&amp;diff=7814"/>
		<updated>2010-09-07T02:35:24Z</updated>

		<summary type="html">&lt;p&gt;Seta00: Created page and added first functions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Point Functions ==&lt;br /&gt;
=== EngFunc_PointContents ===&lt;br /&gt;
This function checks an origin and gives us information of its whearabouts.&lt;br /&gt;
&lt;br /&gt;
The constants that this function returns are these:&lt;br /&gt;
 #define	CONTENTS_EMPTY                  -1&lt;br /&gt;
 #define	CONTENTS_SOLID                  -2&lt;br /&gt;
 #define	CONTENTS_WATER                  -3&lt;br /&gt;
 #define	CONTENTS_SLIME                  -4&lt;br /&gt;
 #define	CONTENTS_LAVA                   -5&lt;br /&gt;
 #define	CONTENTS_SKY                    -6&lt;br /&gt;
 #define	CONTENTS_ORIGIN                 -7          // Removed at csg time&lt;br /&gt;
 #define	CONTENTS_CLIP                   -8          // Changed to contents_solid&lt;br /&gt;
 #define	CONTENTS_CURRENT_0              -9&lt;br /&gt;
 #define	CONTENTS_CURRENT_90             -10&lt;br /&gt;
 #define	CONTENTS_CURRENT_180            -11&lt;br /&gt;
 #define	CONTENTS_CURRENT_270            -12&lt;br /&gt;
 #define	CONTENTS_CURRENT_UP             -13&lt;br /&gt;
 #define	CONTENTS_CURRENT_DOWN           -14&lt;br /&gt;
 #define	CONTENTS_TRANSLUCENT            -15&lt;br /&gt;
 #define	CONTENTS_LADDER                 -16&lt;br /&gt;
 #define	CONTENT_FLYFIELD                -17&lt;br /&gt;
 #define	CONTENT_GRAVITY_FLYFIELD        -18&lt;br /&gt;
 #define	CONTENT_FOG                     -19&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3]&lt;br /&gt;
static result&lt;br /&gt;
result = engfunc(EngFunc_PointContents, origin)&lt;br /&gt;
// if for example result is CONTENTS_SKY&lt;br /&gt;
// then the origin that we see is in the sky we can for example use this to see where a player is aming if he is aiming at sky this will be the result!  &amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== EngFunc_GetBonePosition ===&lt;br /&gt;
[[Image:PlayerSkeleton.jpg|frame|This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.]]&lt;br /&gt;
This function allows to get the bone positions of an entity. This is best used on getting specific player origin points.&lt;br /&gt;
&lt;br /&gt;
These are the bones that a player has:&lt;br /&gt;
&lt;br /&gt;
 Bone 1 Name:  &amp;quot;Bip01&amp;quot;&lt;br /&gt;
 Bone 2 Name:  &amp;quot;Bip01 Pelvis&amp;quot;&lt;br /&gt;
 Bone 3 Name:  &amp;quot;Bip01 Spine&amp;quot;&lt;br /&gt;
 Bone 4 Name:  &amp;quot;Bip01 Spine1&amp;quot;&lt;br /&gt;
 Bone 5 Name:  &amp;quot;Bip01 Spine2&amp;quot;&lt;br /&gt;
 Bone 6 Name:  &amp;quot;Bip01 Spine3&amp;quot;&lt;br /&gt;
 Bone 7 Name:  &amp;quot;Bip01 Neck&amp;quot;&lt;br /&gt;
 Bone 8 Name:  &amp;quot;Bip01 Head&amp;quot;&lt;br /&gt;
 Bone 9 Name:  &amp;quot;Bone01&amp;quot;&lt;br /&gt;
 Bone 10 Name: &amp;quot;Bip01 L Clavicle&amp;quot;&lt;br /&gt;
 Bone 11 Name: &amp;quot;Bip01 L UpperArm&amp;quot;&lt;br /&gt;
 Bone 12 Name: &amp;quot;Bip01 L Forearm&amp;quot;&lt;br /&gt;
 Bone 13 Name: &amp;quot;Bip01 L Hand&amp;quot;&lt;br /&gt;
 Bone 14 Name: &amp;quot;Bip01 L Finger0&amp;quot;&lt;br /&gt;
 Bone 15 Name: &amp;quot;Bip01 L Finger01&amp;quot;&lt;br /&gt;
 Bone 16 Name: &amp;quot;Bip01 L Finger1&amp;quot;&lt;br /&gt;
 Bone 17 Name: &amp;quot;Bip01 L Finger11&amp;quot;&lt;br /&gt;
 Bone 18 Name: &amp;quot;-- L knuckle&amp;quot;&lt;br /&gt;
 Bone 19 Name: &amp;quot;-- L Forearm twist&amp;quot;&lt;br /&gt;
 Bone 20 Name: &amp;quot;-- L wrist&amp;quot;&lt;br /&gt;
 Bone 21 Name: &amp;quot;-- L Elbow&amp;quot;&lt;br /&gt;
 Bone 22 Name: &amp;quot;-- L bicep twist&amp;quot;&lt;br /&gt;
 Bone 23 Name: &amp;quot;-- L shoulder outside&amp;quot;&lt;br /&gt;
 Bone 24 Name: &amp;quot;-- L Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 25 Name: &amp;quot;Bip01 R Clavicle&amp;quot;&lt;br /&gt;
 Bone 26 Name: &amp;quot;Bip01 R UpperArm&amp;quot;&lt;br /&gt;
 Bone 27 Name: &amp;quot;Bip01 R Forearm&amp;quot;&lt;br /&gt;
 Bone 28 Name: &amp;quot;Bip01 R Hand&amp;quot;&lt;br /&gt;
 Bone 29 Name: &amp;quot;Bip01 R Finger0&amp;quot;&lt;br /&gt;
 Bone 30 Name: &amp;quot;Bip01 R Finger01&amp;quot;&lt;br /&gt;
 Bone 31 Name: &amp;quot;Bip01 R Finger1&amp;quot;&lt;br /&gt;
 Bone 32 Name: &amp;quot;Bip01 R Finger11&amp;quot;&lt;br /&gt;
 Bone 33 Name: &amp;quot;-- R knuckle&amp;quot;&lt;br /&gt;
 Bone 34 Name: &amp;quot;-- R wrist&amp;quot;&lt;br /&gt;
 Bone 35 Name: &amp;quot;-- R forearm twist&amp;quot;&lt;br /&gt;
 Bone 36 Name: &amp;quot;-- R Elbow&amp;quot;&lt;br /&gt;
 Bone 37 Name: &amp;quot;-- R bicep twist&amp;quot;&lt;br /&gt;
 Bone 38 Name: &amp;quot;-- R Shoulder inside&amp;quot;&lt;br /&gt;
 Bone 39 Name: &amp;quot;-- R shoulder outside&amp;quot;&lt;br /&gt;
 Bone 40 Name: &amp;quot;-- Neck smooth&amp;quot;&lt;br /&gt;
 Bone 41 Name: &amp;quot;-- R Butt&amp;quot;&lt;br /&gt;
 Bone 42 Name: &amp;quot;-- L butt&amp;quot;&lt;br /&gt;
 Bone 43 Name: &amp;quot;Bip01 L Thigh&amp;quot;&lt;br /&gt;
 Bone 44 Name: &amp;quot;Bip01 L Calf&amp;quot;&lt;br /&gt;
 Bone 45 Name: &amp;quot;Bip01 L Foot&amp;quot;&lt;br /&gt;
 Bone 46 Name: &amp;quot;Bip01 L Toe0&amp;quot;&lt;br /&gt;
 Bone 47 Name: &amp;quot;-- L ankle&amp;quot;&lt;br /&gt;
 Bone 48 Name: &amp;quot;-- L Knee&amp;quot;&lt;br /&gt;
 Bone 49 Name: &amp;quot;Bip01 R Thigh&amp;quot;&lt;br /&gt;
 Bone 50 Name: &amp;quot;Bip01 R Calf&amp;quot;&lt;br /&gt;
 Bone 51 Name: &amp;quot;Bip01 R Foot&amp;quot;&lt;br /&gt;
 Bone 52 Name: &amp;quot;Bip01 R Toe0&amp;quot;&lt;br /&gt;
 Bone 53 Name: &amp;quot;-- R Ankle&amp;quot;&lt;br /&gt;
 Bone 54 Name: &amp;quot;-- R Knee&amp;quot;&lt;br /&gt;
 Bone 55 Name: &amp;quot;Bomb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&amp;lt;pawn&amp;gt;// ENTITY is the player entity id&lt;br /&gt;
// BONE_NUMBER you have to choose from the list above&lt;br /&gt;
// bone_origin[3] is the vector where we save the bone origin&lt;br /&gt;
// bone_angles[3] the vector that holds the angles of the bone.&lt;br /&gt;
engfunc(EngFunc_GetBonePosition, ENTITY, BONE_NUMBER, Float:bone_origin[3], Float:bone_angles[3])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Useful Stocks ====&lt;br /&gt;
These stocks are made for CS/CZ, you need to port them to other mods.&lt;br /&gt;
===== get_bone_hitgroup =====&lt;br /&gt;
This gets the hitgroup of the bone:&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define BONE_HIT_HEAD		8&lt;br /&gt;
#define BONE_HIT_CHEST		6&lt;br /&gt;
#define BONE_HIT_STOMACH	4&lt;br /&gt;
#define BONE_HIT_LEFTARM	24&lt;br /&gt;
#define BONE_HIT_RIGHTARM	39&lt;br /&gt;
#define BONE_HIT_LEFTLEG	48&lt;br /&gt;
#define BONE_HIT_RIGHTLEG	54&lt;br /&gt;
#define HEAD_NECK		40&lt;br /&gt;
#define BONE_L_BUTT		41&lt;br /&gt;
#define BONE_R_BUTT		42&lt;br /&gt;
&lt;br /&gt;
stock get_bone_hitgroup(number)&lt;br /&gt;
{&lt;br /&gt;
    switch (number)&lt;br /&gt;
    {&lt;br /&gt;
        case HEAD_NECK:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_HEAD&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_L_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_LEFTLEG&lt;br /&gt;
        }&lt;br /&gt;
        case BONE_R_BUTT:&lt;br /&gt;
        {&lt;br /&gt;
            return HIT_RIGHTLEG&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    if (1 &amp;lt;= number &amp;lt;= BONE_HIT_STOMACH)&lt;br /&gt;
        return HIT_STOMACH&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_STOMACH &amp;lt; number &amp;lt;= BONE_HIT_CHEST)&lt;br /&gt;
        return HIT_CHEST&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_CHEST &amp;lt; number &amp;lt;= BONE_HIT_HEAD)&lt;br /&gt;
        return HIT_HEAD&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_HEAD &amp;lt; number &amp;lt;= BONE_HIT_LEFTARM)&lt;br /&gt;
        return HIT_LEFTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTARM &amp;lt; number &amp;lt;= BONE_HIT_RIGHTARM)&lt;br /&gt;
        return HIT_RIGHTARM&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_RIGHTARM &amp;lt; number &amp;lt;= BONE_HIT_LEFTLEG)&lt;br /&gt;
        return HIT_LEFTLEG&lt;br /&gt;
    &lt;br /&gt;
    if (BONE_HIT_LEFTLEG &amp;lt; number &amp;lt;= BONE_HIT_RIGHTLEG)&lt;br /&gt;
        return HIT_RIGHTLEG&lt;br /&gt;
    &lt;br /&gt;
    return HIT_GENERIC&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== find_closest_bone_to_gunshot =====&lt;br /&gt;
This gets the closest bone to the gunshot (Use this in FM_TraceLine and Ham_TraceAttack):&lt;br /&gt;
&amp;lt;pawn&amp;gt;#define DISTANCE_CLEAR_HIT        2.0&lt;br /&gt;
&lt;br /&gt;
stock find_closest_bone_to_gunshot(victim, Float:endtrace[3])&lt;br /&gt;
{&lt;br /&gt;
    new Float:angles[3], Float:origin[3], Float:dist = 9999999.99, Float:curorigin[3], bone_nr&lt;br /&gt;
    for (new i=1;i&amp;lt;=54;i++)&lt;br /&gt;
    {&lt;br /&gt;
        // Get the bone position&lt;br /&gt;
        engfunc(EngFunc_GetBonePosition, victim, i, curorigin, angles)&lt;br /&gt;
        // Calculate the distance vector&lt;br /&gt;
        xs_vec_sub(curorigin, endtrace, angles)&lt;br /&gt;
        &lt;br /&gt;
        // If this is smaller than the last small distance remember the value!&lt;br /&gt;
        if (xs_vec_len(angles) &amp;lt;= dist)&lt;br /&gt;
        {&lt;br /&gt;
            origin = curorigin&lt;br /&gt;
            dist = xs_vec_len(angles)&lt;br /&gt;
            bone_nr = i&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        // If distance is smaller than CLEARHIT! Break (We accept the last value!)&lt;br /&gt;
        if (dist &amp;lt;= DISTANCE_CLEAR_HIT)&lt;br /&gt;
        {&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    // Return the bone&lt;br /&gt;
    return bone_nr&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Messaging Functions ==&lt;br /&gt;
=== EngFunc_MessageBegin ===&lt;br /&gt;
This function is used to generate client messages.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
Syntax:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin, dest, msg_type, origin[3] = {0, 0, 0}, player = 0)&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pawn&amp;gt;static Float:origin[3] // Origin should be a Float&lt;br /&gt;
pev(id, pev_origin, origin) // Get user origin&lt;br /&gt;
engfunc(EngFunc_MessageBegin,MSG_BROADCAST,SVC_TEMPENTITY,origin,0) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ONE_UNRELIABLE:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
With MSG_ALL:&lt;br /&gt;
&amp;lt;pawn&amp;gt;engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,_,id) // Create message&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dest can be:&lt;br /&gt;
&lt;br /&gt;
 #define    MSG_BROADCAST               0        // Unreliable to all, There is not id&lt;br /&gt;
 #define    MSG_ONE                     1        // Reliable to one (msg_entity)&lt;br /&gt;
 #define    MSG_ALL                     2        // Reliable to all, There is not origin&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,&lt;br /&gt;
                                                 // put in unreliable datagram (could be  dropped), there is not origin&lt;br /&gt;
 #define    MSG_SPEC                    9        // Sends to all spectator proxies&lt;br /&gt;
&lt;br /&gt;
'''Before calling another EngFunc_MessageBegin you must call message_end().'''&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=File:PlayerSkeleton.jpg&amp;diff=7813</id>
		<title>File:PlayerSkeleton.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=File:PlayerSkeleton.jpg&amp;diff=7813"/>
		<updated>2010-09-07T02:18:16Z</updated>

		<summary type="html">&lt;p&gt;Seta00: This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This image shows the locations of the bones, they are marked through blue points. The red point is the player origin.&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Writing_Extensions&amp;diff=7812</id>
		<title>Writing Extensions</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Writing_Extensions&amp;diff=7812"/>
		<updated>2010-09-06T16:06:24Z</updated>

		<summary type="html">&lt;p&gt;Seta00: /* Include Paths */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SourceMod's Extension System is a powerful way to greatly enhance the flexibility of your SourceMod plugins.  You can take full advantage of SourceMod's Core, using the interfaces it provides, to create C++ plugins, plugin events, plugin native functions, and shared interfaces.  Extensions can also hook into Metamod:Source.&lt;br /&gt;
&lt;br /&gt;
This article goes into the details of creating a SourceMod Extension.  Knowledge of C++ is required.&lt;br /&gt;
&lt;br /&gt;
=SDK Structure=&lt;br /&gt;
First, download the [[SourceMod SDK]] from the [[SourceMod]] website.  The directory structure looks like this:&lt;br /&gt;
*&amp;lt;tt&amp;gt;extensions&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;geoip/&amp;lt;/tt&amp;gt; - Source code to the GeoIP extension&lt;br /&gt;
**&amp;lt;tt&amp;gt;mysql/&amp;lt;/tt&amp;gt; - Source code to the MySQL extension&lt;br /&gt;
**&amp;lt;tt&amp;gt;threader/&amp;lt;/tt&amp;gt; - Source code to the Threader extension&lt;br /&gt;
*&amp;lt;tt&amp;gt;plugins/&amp;lt;/tt&amp;gt; - Source code to all of SourceMod's plugins&lt;br /&gt;
**&amp;lt;tt&amp;gt;include/&amp;lt;/tt&amp;gt; - The include files which document plugin API&lt;br /&gt;
*&amp;lt;tt&amp;gt;public/&amp;lt;/tt&amp;gt; - Interface files for SourceMod's Core Interfaces&lt;br /&gt;
**&amp;lt;tt&amp;gt;extensions/&amp;lt;/tt&amp;gt; - Interfaces that are provided by extensions&lt;br /&gt;
**&amp;lt;tt&amp;gt;sample_ext/&amp;lt;/tt&amp;gt; - The Sample Extension SDK&lt;br /&gt;
**&amp;lt;tt&amp;gt;sourcepawn&amp;lt;/tt&amp;gt; - The include/interface files for SourcePawn&lt;br /&gt;
*&amp;lt;tt&amp;gt;sourcepawn/&amp;lt;/tt&amp;gt;&lt;br /&gt;
**&amp;lt;tt&amp;gt;compiler/&amp;lt;/tt&amp;gt; - The SourcePawn Compiler&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Starting an Extension=&lt;br /&gt;
For simplicity, this article will assume you are using the SDK base files.  These are:&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdk/smsdk_config.h&amp;lt;/tt&amp;gt; - Configuration settings (we will be editing this)&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdk/smsdk_ext.h&amp;lt;/tt&amp;gt; - Header for SDK wrappers (usually never needs to be edited)&lt;br /&gt;
**''Note: Sometimes, this may be updated by the SourceMod Dev Team.  Using a newest version is recommended.'&lt;br /&gt;
*&amp;lt;tt&amp;gt;sdk/smsdk_ext.cpp&amp;lt;/tt&amp;gt; - Source for SDK wrappers (usually never needs to be edited)&lt;br /&gt;
**''Note: Sometimes, this may be updated by the SourceMod Dev Team.  Using a newest version is recommended.'&lt;br /&gt;
*&amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; - User file for main extension header&lt;br /&gt;
*&amp;lt;tt&amp;gt;extension.cpp&amp;lt;/tt&amp;gt; - User file for main extension code&lt;br /&gt;
&lt;br /&gt;
''The &amp;lt;tt&amp;gt;extension.*&amp;lt;/tt&amp;gt; files are not technically part of the SDK.  However, they are provided to give users a starting point and some documentation.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Note:''' For help setting up Visual Studio, please see [[#Setting up Visual Studio|Setting up Visual Studio]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first step of creating your extension is to configure it.  Open the &amp;lt;tt&amp;gt;smsdk_config.h&amp;lt;/tt&amp;gt; file and edit each of the following defines.  Use the information below to guide you.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_NAME&amp;lt;/tt&amp;gt; - The general name for your Extension (should be short).&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_DESCRIPTION&amp;lt;/tt&amp;gt; - A short description of what your extension does.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_VERSION&amp;lt;/tt&amp;gt; - A version number string.  By convention, SourceMod uses the four set build number notation.  I.e. for 1.2.3.4:&lt;br /&gt;
**&amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt; is the &amp;quot;Major&amp;quot; release version.&lt;br /&gt;
**&amp;lt;tt&amp;gt;2&amp;lt;/tt&amp;gt; is the &amp;quot;Minor&amp;quot; release version.&lt;br /&gt;
**&amp;lt;tt&amp;gt;3&amp;lt;/tt&amp;gt; is the &amp;quot;Maintenance&amp;quot; or &amp;quot;Revision&amp;quot; version.&lt;br /&gt;
**&amp;lt;tt&amp;gt;4&amp;lt;/tt&amp;gt; is the &amp;quot;Build,&amp;quot; usually an internal source control number.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_AUTHOR&amp;lt;/tt&amp;gt; - Your name (or whoever/whatever authored the plugin).&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_URL&amp;lt;/tt&amp;gt; - The URL/homepage of this extension.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_LOGTAG&amp;lt;/tt&amp;gt; - The logtag your extension will use for SourceMod logging.  By convention, try to keep this under ten characters or so, and to make it all caps.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_LICENSE&amp;lt;/tt&amp;gt; - Right now, the SourceMod Dev Team mandates that 3rd party extensions must be under an Open Source license.  Putting a license abbreviation or very short message here is appropriate.  For more information, see [[SourceMod License]].&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_DATESTRING&amp;lt;/tt&amp;gt; - You do not need to modify this.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_CONF_METAMOD&amp;lt;/tt&amp;gt; - If your plugin requires using SourceHook or Metamod:Source, uncomment this line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you may want to change the name of the default class that &amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; declares.  To do this...&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Open &amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; and change &amp;quot;Sample&amp;quot; in this line:&lt;br /&gt;
&amp;lt;cpp&amp;gt;class Sample : public SDKExtension&amp;lt;/cpp&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open &amp;lt;tt&amp;gt;extension.cpp&amp;lt;/tt&amp;gt; and change the two lines to correspond to your new class name.  You can also change the global singleton that's declared, although you cannot remove the &amp;lt;tt&amp;gt;SMEXT_LINK&amp;lt;/tt&amp;gt; line (this lets SourceMod load your extension).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Visual Studio Users==&lt;br /&gt;
Make sure you change the name of your &amp;lt;tt&amp;gt;.dll&amp;lt;/tt&amp;gt; file.  The naming convention for SourceMod extensions is &amp;lt;tt&amp;gt;name.ext.dll&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; is a short name for your extension.  You are free to change this, but it is highly recommended that you keep the &amp;lt;tt&amp;gt;.ext.dll&amp;lt;/tt&amp;gt; intact.&lt;br /&gt;
&lt;br /&gt;
You can do this by going to &amp;lt;tt&amp;gt;Project&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;Properties&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;Configuration Properties&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;Linker&amp;lt;/tt&amp;gt; -&amp;gt; &amp;lt;tt&amp;gt;General&amp;lt;/tt&amp;gt;.  Set the &amp;lt;tt&amp;gt;Output File&amp;lt;/tt&amp;gt; option appropriately.&lt;br /&gt;
&lt;br /&gt;
==Linux Users==&lt;br /&gt;
Simply edit the &amp;lt;tt&amp;gt;Makefile&amp;lt;/tt&amp;gt; and change the &amp;lt;tt&amp;gt;BINARY&amp;lt;/tt&amp;gt; line near the top.  Make sure you do not add any trailing spaces at the end of the name, or the build won't come out right.&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile a blank extension!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Creating Native Functions=&lt;br /&gt;
''Main article: [[Natives (SourceMod Development)]]''&lt;br /&gt;
&lt;br /&gt;
Most of the time, an extension exists to add &amp;quot;native functions&amp;quot; to the plugin system.  Native functions are simply the functions that plugins can use in SourceMod.  They are coded in C++ and have a short prototype declaration in an include file.&lt;br /&gt;
&lt;br /&gt;
==Prototyping==&lt;br /&gt;
The first step to creating a native is to &amp;lt;tt&amp;gt;spec it&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;prototype&amp;lt;/tt&amp;gt; it.  This is a simple but often time consuming process, but if you get in the habit of it, your documentation will be much better.  Let's first create a very simply native.  Here is a prototype for it, which we will place in &amp;lt;tt&amp;gt;sample.inc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pawn&amp;gt;/**&lt;br /&gt;
 * Returns the square of a number.&lt;br /&gt;
 *&lt;br /&gt;
 * @param num	Number to square.&lt;br /&gt;
 * @return	The square of num.&lt;br /&gt;
 */&lt;br /&gt;
native SquareNumber(num);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;native&amp;lt;/tt&amp;gt; keyword tells the compiler that this function exists in an outside source.  The comment style is similar to [http://www.stack.nl/~dimitri/doxygen/ doxygen] or [http://java.sun.com/j2se/javadoc/ Javadoc], and is preferred by the SourceMod Development Team.&lt;br /&gt;
&lt;br /&gt;
==Implementing==&lt;br /&gt;
Now that our function is documented, it's time to create it!  Each native function is bound to a C++ function.  The prototype for this function looks like:&lt;br /&gt;
&amp;lt;cpp&amp;gt;cell_t Function(IPluginContext *pContext, const cell_t *params);&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A quick explanation of these types:&lt;br /&gt;
*&amp;lt;tt&amp;gt;cell_t&amp;lt;/tt&amp;gt; - This is a 32bit signed integer, the generic data type for Pawn.&lt;br /&gt;
*&amp;lt;tt&amp;gt;IPluginContext&amp;lt;/tt&amp;gt; - This interface provides Virtual Machine functions for retrieving or modifying memory in the plugin.&lt;br /&gt;
*&amp;lt;tt&amp;gt;params&amp;lt;/tt&amp;gt; - This is the &amp;quot;stack&amp;quot; of parameters that the plugin passed.  It is an array from [0..N] where 0 contains N.  &lt;br /&gt;
**For example, if one parameter was passed, and the parameter is 25:&lt;br /&gt;
***&amp;lt;tt&amp;gt;params[0]&amp;lt;/tt&amp;gt; == 1&lt;br /&gt;
***&amp;lt;tt&amp;gt;params[1]&amp;lt;/tt&amp;gt; == 25&lt;br /&gt;
**Even though it tells you how many parameters are passed, you do not need to verify this number.  The compiler will always pass the correct number of parameters in.  The only time you need to verify it is for backwards compatibility or variable parameter lists, which will be discussed later.&lt;br /&gt;
&lt;br /&gt;
Now, let's write our native function:&lt;br /&gt;
&amp;lt;cpp&amp;gt;cell_t SquareNumber(IPluginContext *pContext, const cell_t *params)&lt;br /&gt;
{&lt;br /&gt;
	cell_t number = params[1];&lt;br /&gt;
	return number * number;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Binding==&lt;br /&gt;
Now, the final step is to bind our native.  Natives are bound in ''native lists''.  Each list must be terminated by a &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; bind.  Example:&lt;br /&gt;
&amp;lt;cpp&amp;gt;const sp_nativeinfo_t MyNatives[] = &lt;br /&gt;
{&lt;br /&gt;
	{&amp;quot;SquareNumber&amp;quot;,	SquareNumber},&lt;br /&gt;
	{NULL,			NULL},&lt;br /&gt;
};&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column/member is a string containing the name you've assigned to the native.  The second column/member is the C++ function you're binding to.  Here, both contain the same name, but it is certainly possible to bind a function to any valid Pawn function name, and likewise, you can bind one function to more than one name.&lt;br /&gt;
&lt;br /&gt;
Lastly, you must tell Core about your native list.  There are two places that are good to do this.  Whichever you choose, you must uncomment the function in &amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; and implement it in &amp;lt;tt&amp;gt;extension.cpp&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SDK_OnLoad&amp;lt;/tt&amp;gt; - This is called when your extension is first loaded.  If you do not require any outside interfaces, it is safe to add natives here.&lt;br /&gt;
*&amp;lt;tt&amp;gt;SDK_OnAllLoaded&amp;lt;/tt&amp;gt; - This is called when all extensions have been loaded.  This is generally a better place to add natives.&lt;br /&gt;
&lt;br /&gt;
Let's say we choose &amp;lt;tt&amp;gt;SDK_OnAllLoaded&amp;lt;/tt&amp;gt;, we'd then have code like this:&lt;br /&gt;
&amp;lt;cpp&amp;gt;void Sample::SDK_OnAllLoaded()&lt;br /&gt;
{&lt;br /&gt;
	sharesys-&amp;gt;AddNatives(myself, MyNatives);&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
''Note: &amp;lt;tt&amp;gt;myself&amp;lt;/tt&amp;gt; is a global variable declared in the SDK.  It is a pointer that identifies your extension.''&lt;br /&gt;
&lt;br /&gt;
For more information on writing natives, see [[Natives (SourceMod Development)]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Creating Events/Forwards=&lt;br /&gt;
Events are an integral part to SourceMod.  An Event is formally called a ''Forward''.  Forwards are functions inside a plugin which are not called by the plugin itself, but are triggered from an external source.  For example, &amp;lt;tt&amp;gt;OnClientConnect&amp;lt;/tt&amp;gt; is a forward which is triggered when a player connects to a server.&lt;br /&gt;
&lt;br /&gt;
There are two major types of forwards:&lt;br /&gt;
*'''Managed''': This forward is global and has a name.  To use this forward, the function must be declared as &amp;lt;tt&amp;gt;public&amp;lt;/tt&amp;gt; inside the user's script.  Any plugin having this public function will receive the event.&lt;br /&gt;
*'''Unmanaged''': This forward is private in nature.  For example, the &amp;lt;tt&amp;gt;HookUserMessage&amp;lt;/tt&amp;gt; native lets users specify a function to be called when a specific user message is sent.  This is done with an unmanaged forward, and adding functions to this forward is not automatic.  In general, function calls for unmanaged forwards are not public, although they can be.&lt;br /&gt;
&lt;br /&gt;
''Note: To enable the Forward interface, you must uncomment the definition &amp;lt;tt&amp;gt;SMEXT_ENABLE_FORWARDSYS&amp;lt;/tt&amp;gt; in smsdk_config.h.''&lt;br /&gt;
==Managed Forwards==&lt;br /&gt;
Let's say we want to create a forward that will be called when a player uses say chat.  For simplicity, let's assume you already have a function that tells you when a player says say chat.  We will just be creating the forward for it.&lt;br /&gt;
&lt;br /&gt;
As we did before, first let's prototype our global forward.  In our include file, we add this:&lt;br /&gt;
&amp;lt;pawn&amp;gt;/**&lt;br /&gt;
 * @brief Called whenever a client says something in chat.&lt;br /&gt;
 *&lt;br /&gt;
 * @param client	Index of the client.&lt;br /&gt;
 * @param text		String containing the say text.&lt;br /&gt;
 * @return 		Pl_Handled to block text from printing, Pl_Continue otherwise.&lt;br /&gt;
 */&lt;br /&gt;
forward ResultType:OnPlayerSayChat(client, const String:text[]);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;forward&amp;lt;/tt&amp;gt; keyword tells the compiler that any function having this name must be declared exactly the same.  In a plugin, this would&lt;br /&gt;
&lt;br /&gt;
The next step is to declare your forward somewhere at the top of your &amp;lt;tt&amp;gt;extension.cpp&amp;lt;/tt&amp;gt; file.  This will look like:&lt;br /&gt;
&amp;lt;cpp&amp;gt;IForward *g_pSayChat = NULL&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, re-using our code from above, let's create this forward in &amp;lt;tt&amp;gt;SDK_OnAllLoaded&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;cpp&amp;gt;void Sample::SDK_OnAllLoaded()&lt;br /&gt;
{&lt;br /&gt;
	sharesys-&amp;gt;AddNatives(myself, MyNatives);&lt;br /&gt;
	g_pSayChat = forwards-&amp;gt;CreateForward(&amp;quot;OnPlayerSayChat&amp;quot;, ET_Event, 2, NULL, Param_Cell, Param_String);&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanation of parameters:&lt;br /&gt;
*&amp;lt;tt&amp;gt;&amp;quot;OnPlayerSayChat&amp;quot;&amp;lt;/tt&amp;gt; - The name of our forward.&lt;br /&gt;
*&amp;lt;tt&amp;gt;ET_Event&amp;lt;/tt&amp;gt; - Since forwards can execute multiple functions in multiple scripts, this is one of the ways of specifying what to do with the return value of each function.  &amp;lt;tt&amp;gt;ET_Event&amp;lt;/tt&amp;gt; means &amp;quot;return the highest value, do not allow stops.&amp;quot;  A stop refers to &amp;lt;tt&amp;gt;Pl_Stop&amp;lt;/tt&amp;gt;, which lets a plugin block the rest of the event chain.&lt;br /&gt;
*&amp;lt;tt&amp;gt;2&amp;lt;/tt&amp;gt; - This is the number of parameters our forward will have.&lt;br /&gt;
*&amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; - Not used in our example.  This lets you pass parameters by array rather than variable arguments.&lt;br /&gt;
*&amp;lt;tt&amp;gt;Param_Cell&amp;lt;/tt&amp;gt; - The first parameter is a cell (integer).&lt;br /&gt;
*&amp;lt;tt&amp;gt;Param_String&amp;lt;/tt&amp;gt; - The second parameter is a string.&lt;br /&gt;
&lt;br /&gt;
Now, we write a quick function in our module to call this forward:&lt;br /&gt;
&amp;lt;cpp&amp;gt;/** Fires the say chat event in plugins.  Returns true to allow the text, false to block. */&lt;br /&gt;
bool FireChatEvent(int client, const char *text)&lt;br /&gt;
{&lt;br /&gt;
	if (!g_pSayChat)&lt;br /&gt;
	{&lt;br /&gt;
		return true;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	cell_t result = 0;&lt;br /&gt;
	g_pSayChat-&amp;gt;PushCell(client);&lt;br /&gt;
	g_pSayChat-&amp;gt;PushString(text);&lt;br /&gt;
	g_pSayChat-&amp;gt;Execute(&amp;amp;result);&lt;br /&gt;
	&lt;br /&gt;
	if (result == Pl_Handled)&lt;br /&gt;
	{&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;
As you can see, this was pretty simple.  Each parameter is &amp;quot;pushed&amp;quot; one at a time, in ascending order.  First we push the client index as a cell, then the text as a string.  Once done, we execute, and the value will be returned by reference.&lt;br /&gt;
&lt;br /&gt;
Lastly, there is a caveat.  Unlike natives, SourceMod does not automatically clean up forwards for us when are done.  We have to make sure we destroy them.  Uncomment &amp;lt;tt&amp;gt;SDK_OnUnload&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; and implement it like so:&lt;br /&gt;
&amp;lt;cpp&amp;gt;void Sample::SDK_OnUnload()&lt;br /&gt;
{&lt;br /&gt;
	forwards-&amp;gt;ReleaseForward(g_pSayChat);&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Unmanaged Forwards==&lt;br /&gt;
Now things get a bit more complicated.  However, unmanaged forwards are essentially the same -- they just give you more flexibility.  Let's consider the managed example with a new twist.  We want to let users add and remove hooks from their plugins, rather than having one global forward.  The standard way to do this is with ''function IDs''.  &lt;br /&gt;
&lt;br /&gt;
Example prototype:&lt;br /&gt;
&amp;lt;pawn&amp;gt;funcenum SayChatHook&lt;br /&gt;
{&lt;br /&gt;
	forward(client, const String:text[]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
native AddSayChatHook(SayChatHook:hook);&lt;br /&gt;
native RemoveSayChatHook(SayChatHook:hook);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;funcenum&amp;lt;/tt&amp;gt; syntax lets you define all the valid prototypes for your hook.  In this example, the only valid method is a function declared like this (only MyHook can be changed):&lt;br /&gt;
&amp;lt;pawn&amp;gt;MyHook(client, const String:text[])&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How do we make such a beast?  The first step is setting up our forward.&lt;br /&gt;
&amp;lt;cpp&amp;gt;IChangeableForward *g_pSayChat = NULL;&lt;br /&gt;
/* ... */&lt;br /&gt;
void Sample::SDK_OnAllLoaded()&lt;br /&gt;
{&lt;br /&gt;
	g_pSayChat = forwards-&amp;gt;CreateForwardEx(NULL, ET_Hook, 2, NULL, Param_Cell, Param_String); &lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice two big differences.  We now use &amp;lt;tt&amp;gt;IChangeableForward&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;IForward&amp;lt;/tt&amp;gt;, and we use &amp;lt;tt&amp;gt;CreateForwardEx&amp;lt;/tt&amp;gt; instead.  The initial first parameter specifies a name for our forward - we're going to ignore this.&lt;br /&gt;
&lt;br /&gt;
Now, we need to create our natives.  These will be fairly simple:&lt;br /&gt;
&amp;lt;cpp&amp;gt;cell_t AddSayChatHook(IPluginContext *pContext, const cell_t *params)&lt;br /&gt;
{&lt;br /&gt;
	g_pSayChat-&amp;gt;AddFunction(pContext, static_cast&amp;lt;funcid_t&amp;gt;(params[1]));&lt;br /&gt;
	return 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
cell_t RemoveSayChatHook(IPluginContext *pContext, const cell_t *params)&lt;br /&gt;
{&lt;br /&gt;
	IPluginFunction *pFunction = pContext-&amp;gt;GetFunctionById(static_cast&amp;lt;funcid_t&amp;gt;(params[1]));&lt;br /&gt;
	g_pSayChat-&amp;gt;RemoveFunction(pFunction);&lt;br /&gt;
	return 1;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
''Note: These natives must be added -- that step is removed here and explained earlier.''&lt;br /&gt;
&lt;br /&gt;
You do not need to worry about a plugin unloading - Core will automatically remove the functions for you.  Since an &amp;lt;tt&amp;gt;IChangeableForward&amp;lt;/tt&amp;gt; is also an &amp;lt;tt&amp;gt;IForward&amp;lt;/tt&amp;gt;, the &amp;lt;tt&amp;gt;FireChatEvent&amp;lt;/tt&amp;gt; function from earlier does not need to change.  We're done!&lt;br /&gt;
&lt;br /&gt;
==Creating Interfaces==&lt;br /&gt;
Do you want your extension to share an interface?  If so, first you should create an ''interface file''.  This file should contain everything your interface needs - this way other authors can easily reference it.  Your interface must inherit the &amp;lt;tt&amp;gt;SMInterface&amp;lt;/tt&amp;gt; class.  It must also declare two global macros that uniquely identify your interface.  It must also implement two functions: &amp;lt;tt&amp;gt;GetInterfaceName&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GetInterfaceVersion&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two defines must start with &amp;lt;tt&amp;gt;SMINTERFACE_&amp;lt;/tt&amp;gt; and end with &amp;lt;tt&amp;gt;_NAME&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;_VERSION&amp;lt;/tt&amp;gt; respectively.  The first must be a string and the second must be an unsigned integer.  This integer represents your interface's version number.  While you are free to use it however you please, by default it should be linearly increased.  If you make breaking changes or change the versioning scheme, you must overload the &amp;lt;tt&amp;gt;IsVersionCompat&amp;lt;/tt&amp;gt; function in &amp;lt;tt&amp;gt;SMInterface&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;cpp&amp;gt;#ifndef _INCLUDE_MYINTERFACE_FILE_H_&lt;br /&gt;
#define _INCLUDE_MYINTERFACE_FILE_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;IShareSys.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SMINTERFACE_MYINTERFACE_NAME	&amp;quot;IMyInterface&amp;quot;&lt;br /&gt;
#define SMINTERFACE_MYINTERFACE_VERSION	1&lt;br /&gt;
&lt;br /&gt;
class IMyInterface : public SourceMod::SMInterface&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
	virtual const char *GetInterfaceName()&lt;br /&gt;
	{&lt;br /&gt;
		return SMINTERFACE_MYINTERFACE_NAME;&lt;br /&gt;
	}&lt;br /&gt;
	virtual unsigned int GetInterfaceVersion()&lt;br /&gt;
	{&lt;br /&gt;
		return SMINTERFACE_MYINTERFACE_VERSION;&lt;br /&gt;
	}&lt;br /&gt;
public:&lt;br /&gt;
	/**&lt;br /&gt;
	 * @brief This function does nothing.&lt;br /&gt;
	 */&lt;br /&gt;
	virtual void DoNothingAtAll() =0;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif //_INCLUDE_MYINTERFACE_FILE_H_&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice, of course, that our interface is ''pure virtual''.  This means it must be implemented in the extension.  Assuming you know C++, this should be fairly straight forward, so let's skip right to how to add this interface to the SourceMod shared system:&lt;br /&gt;
&amp;lt;cpp&amp;gt;bool Sample::SDK_OnLoad(char *error, size_t err_max, bool late)&lt;br /&gt;
{&lt;br /&gt;
	sharesys-&amp;gt;AddInterface(myself, &amp;amp;g_MyInterface);&lt;br /&gt;
	return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
''Note: We do this in &amp;lt;tt&amp;gt;SDK_OnLoad()&amp;lt;/tT&amp;gt; instead of &amp;lt;tt&amp;gt;SDK_OnAllLoaded()&amp;lt;/tt&amp;gt;.  Otherwise, an extension might try to search for your interface during &amp;lt;tt&amp;gt;SDK_OnAllLoaded()&amp;lt;/tt&amp;gt;, and it might fail depending on the load order.''&lt;br /&gt;
&lt;br /&gt;
That simple?  Yup!  Now other extensions can use your interface.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using Interfaces/Other Extensions=&lt;br /&gt;
There are a variety of interfaces that are available, but not loaded by default in the Extension SDK.  These interfaces can be retrieved and used in your extension.&lt;br /&gt;
&lt;br /&gt;
==Core Interfaces==&lt;br /&gt;
If they are provided by Core, getting them is very simple.  Many interfaces can simply be uncommented in &amp;lt;tt&amp;gt;smsdk_config.h&amp;lt;/tt&amp;gt; and they will become usable.  See the &amp;quot;Available Interfaces&amp;quot; list below for the exposure list.&lt;br /&gt;
&lt;br /&gt;
Otherwise, most of the &amp;lt;tt&amp;gt;.h&amp;lt;/tt&amp;gt; interface files in the root of the &amp;lt;tt&amp;gt;public&amp;lt;/tt&amp;gt; folder in the SDK are Core interfaces.  For example, code to use the IPluginManager interface might look like this:&lt;br /&gt;
&amp;lt;cpp&amp;gt;#include &amp;lt;IPluginSys.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IPluginManager *g_pPlugins = NULL;&lt;br /&gt;
&lt;br /&gt;
bool Sample::SDK_OnLoad(char *error, size_t err_max, bool late)&lt;br /&gt;
{&lt;br /&gt;
	SM_GET_IFACE(PLUGINSYSTEM, g_pPlugins);&lt;br /&gt;
	return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where did we get &amp;lt;tt&amp;gt;PLUGINSYSTEM&amp;lt;/tt&amp;gt; from?  Observe the two lines in &amp;lt;tt&amp;gt;IPluginSys.h&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;cpp&amp;gt;#define SMINTERFACE_PLUGINSYSTEM_NAME		&amp;quot;IPluginManager&amp;quot;&lt;br /&gt;
#define SMINTERFACE_PLUGINSYSTEM_VERSION	1&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;SM_GET_IFACE&amp;lt;/tt&amp;gt; macro uses the text in between the &amp;lt;tt&amp;gt;SMINTERFACE_&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;_NAME&amp;lt;/tt&amp;gt; characters.  It also uses the version for compatibility checking.  If it can't find the interface, it automatically prints to the error buffer and returns false.&lt;br /&gt;
&lt;br /&gt;
===Default Interfaces===&lt;br /&gt;
There are interfaces which are grabbed by the Extension SDK by default.  You do not need to query for them on load, or even check if they are valid or not.  They are:&lt;br /&gt;
*&amp;lt;tt&amp;gt;IShareSys&amp;lt;/tt&amp;gt; - Exposed as &amp;lt;tt&amp;gt;sharesys&amp;lt;/tt&amp;gt;, found in &amp;lt;tt&amp;gt;IShareSys.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;HANDLESYSTEM&amp;lt;/tt&amp;gt; - Exposed as &amp;lt;tt&amp;gt;handlesys&amp;lt;/tt&amp;gt;, found in &amp;lt;tt&amp;gt;IHandleSys.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SOURCEMOD&amp;lt;/tt&amp;gt; - Exposed as &amp;lt;tt&amp;gt;g_pSM&amp;lt;/tt&amp;gt;, found in &amp;lt;tt&amp;gt;ISourceMod.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;FORWARDMANAGER&amp;lt;/tt&amp;gt; - Exposed as &amp;lt;tt&amp;gt;forwards&amp;lt;/tt&amp;gt;, found in &amp;lt;tt&amp;gt;IForwardSys.h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Available Interfaces===&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_FORWARDSYS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;forwards&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_HANDLESYS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;handlesys&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_PLAYERHELPERS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;playerhelpers&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_DBMANAGER&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;dbi&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_GAMECONF&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;gameconfs&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_MEMUTILS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;memutils&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_GAMEHELPERS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;gamehelpers&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_TIMERSYS&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;timersys&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;SMEXT_ENABLE_THREADER&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;threader&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Interfaces==&lt;br /&gt;
The situation changes if your extension requires ''another extension'', since extensions may load in a completely random order.  The first step is to mark the other extension as a dependency.  Let's say you want to use the &amp;lt;tt&amp;gt;IThreader.h&amp;lt;/tt&amp;gt; interfaces from &amp;lt;tt&amp;gt;threader.ext.dll&amp;lt;/tt&amp;gt;.  First, we declare it as such:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;bool Sample::SDK_OnLoad(char *error, size_t err_max, bool late)&lt;br /&gt;
{&lt;br /&gt;
	sharesys-&amp;gt;AddDependency(myself, &amp;quot;thread.ext&amp;quot;, true, true);&lt;br /&gt;
	return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two boolean parameters to &amp;lt;tt&amp;gt;AddDependency&amp;lt;/tt&amp;gt; mean, respectively: &amp;quot;try to automatically load this extension&amp;quot; and &amp;quot;this extension cannot work without the dependency.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Second, we query for the interface in &amp;lt;tt&amp;gt;SDK_OnAllLoaded&amp;lt;/tt&amp;gt;.  Since we don't know when &amp;lt;tt&amp;gt;thread.ext&amp;lt;/tt&amp;gt; will actually be loaded, we have to wait until everything is definitely loaded.&lt;br /&gt;
&amp;lt;cpp&amp;gt;IThreader *g_pThreader = NULL;&lt;br /&gt;
/* ... */&lt;br /&gt;
void Sample::SDK_OnAllLoaded()&lt;br /&gt;
{&lt;br /&gt;
	SM_GET_LATE_IFACE(THREADER, g_pThreader);&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Third, we need to find a way to fail if this interface was never found.  The way to do this is by uncommenting &amp;lt;tt&amp;gt;QueryRunning&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;extension.h&amp;lt;/tt&amp;gt; and implementing it:&lt;br /&gt;
&amp;lt;cpp&amp;gt;bool Sample::QueryRunning(char *error, size_t err_max)&lt;br /&gt;
{&lt;br /&gt;
	SM_CHECK_IFACE(THREADER, g_pThreader);&lt;br /&gt;
	return true;&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When SourceMod queries your extension, the macro above will either validate the pointer or return false.  If it returns false, SourceMod marks your extension as failed.&lt;br /&gt;
&lt;br /&gt;
==Caveats==&lt;br /&gt;
===NULL Interfaces===&lt;br /&gt;
There are a few ways that external interfaces can make your code complicated.  The first is simple but a common oversight.  Don't assume interfaces will be okay.  For example, say we want to create a thread once we get the &amp;lt;tt&amp;gt;IThreader&amp;lt;/tt&amp;gt; interface.  Our code should something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;void Sample::SDK_OnAllLoaded()&lt;br /&gt;
{&lt;br /&gt;
	SM_GET_IFACE(THREADER, g_pThreader);&lt;br /&gt;
	&lt;br /&gt;
	if (QueryRunning(NULL, 0))&lt;br /&gt;
	{&lt;br /&gt;
		g_pThreader-&amp;gt;MakeThread(/* stuff */);&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we ''query ourself'' in order to find if it's safe to continue executing code.  We could also have simply checked if &amp;lt;tt&amp;gt;g_pThreader&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt;, but self-querying has a bonus: if your extension continues to do things like hook events or add listeners, you will be preventing your extension from entirely initializing itself while one interface is bad.  Always make sure you have sanity checks like this where needed.&lt;br /&gt;
&lt;br /&gt;
===Dynamic Unloading===&lt;br /&gt;
The second major caveat is that extensions can be dynamically unloaded.  If you specified yourself as having a dependency and that each dependency is required, you will have no problem.  Your extension will be unloaded before the interface is removed, and you can clean up memory/hooks in your &amp;lt;tt&amp;gt;SDK_OnUnload()&amp;lt;/tt&amp;gt; code.  There are two situations where this is a different story.&lt;br /&gt;
&lt;br /&gt;
====Optional Interfaces====&lt;br /&gt;
The first situation is if you are not requiring an extension that contains an interface.  Now, when the extension unloads, your extension will not be unloaded first.  This creates a small problem, as you must clean up without being unloaded.  There are two functions you can implement in your extension class to resolve this, both documented in &amp;lt;tt&amp;gt;IExtensionSys.h&amp;lt;/tt&amp;gt;:&lt;br /&gt;
*&amp;lt;tt&amp;gt;QueryInterfaceDrop&amp;lt;/tt&amp;gt; - Allows you to request unloading when a specific interface is unloaded.  This is the default behavior for all interfaces.  If you want to block this functionality, continue reading.&lt;br /&gt;
*&amp;lt;tt&amp;gt;NotifyInterfaceDrop&amp;lt;/tt&amp;gt; - This is called when an interface is dropped.  If your plugin will not be unloaded, you can use this to clean up any resources on a specific interface being removed.&lt;br /&gt;
&lt;br /&gt;
====Circular Dependencies====&lt;br /&gt;
The second situation is a bit more complicated.  It is possible for two extensions to have circular dependencies.  For example:&lt;br /&gt;
*Extension &amp;quot;A&amp;quot; requires extension &amp;quot;B.&amp;quot;&lt;br /&gt;
*Extension &amp;quot;B&amp;quot; requires extension &amp;quot;A.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If either extension is unloaded, the opposite extension is unloaded normally.  The first extension then receives the interface drop callbacks.  In this situation, it is essential that the &amp;lt;tt&amp;gt;NotifyInterfaceDrop&amp;lt;/tt&amp;gt; function be implemented and used with the circular interface.  Otherwise, you risk crashing when your extension unloads (or at the very least, leaking memory).  Since the actual drop order is undefined, it means both extensions must implement this function to be safe.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Automatic Loading=&lt;br /&gt;
There are two types of automatic loading: Dynamic and Global.  Dynamic loading means your extension is only loaded when a plugin requires it.  Global loading means your extension loads no matter what.&lt;br /&gt;
&lt;br /&gt;
==Dynamic Autoloading==&lt;br /&gt;
Dynamic loading requires that you create an include file for plugins.  Plugins that include your file will automatically load your extension.  This requires implementing the &amp;lt;tt&amp;gt;Extension&amp;lt;/tt&amp;gt; structure found in &amp;lt;tt&amp;gt;core.inc&amp;lt;/tt&amp;gt;.  You must expose the structure as &amp;lt;tt&amp;gt;public&amp;lt;/tt&amp;gt;, and the name must start with &amp;quot;&amp;lt;tt&amp;gt;__ext_&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;/**&lt;br /&gt;
 * Do not edit below this line!&lt;br /&gt;
 */&lt;br /&gt;
public Extension:__ext_geoip = &lt;br /&gt;
{&lt;br /&gt;
	name = &amp;quot;GeoIP&amp;quot;,&lt;br /&gt;
	file = &amp;quot;geoip.ext&amp;quot;,&lt;br /&gt;
#if defined AUTOLOAD_EXTENSIONS&lt;br /&gt;
	autoload = 1,&lt;br /&gt;
#else&lt;br /&gt;
	autoload = 0,&lt;br /&gt;
#endif&lt;br /&gt;
#if defined REQUIRE_EXTENSIONS&lt;br /&gt;
	required = 1,&lt;br /&gt;
#else&lt;br /&gt;
	required = 0,&lt;br /&gt;
#endif&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explanations:&lt;br /&gt;
*&amp;lt;b&amp;gt;name&amp;lt;/b&amp;gt;: The name of your module as written in &amp;lt;tt&amp;gt;SMEXT_CONF_NAME&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;b&amp;gt;file&amp;lt;/b&amp;gt;: The platform-inspecific portion of your extension's file name.&lt;br /&gt;
*&amp;lt;b&amp;gt;autoload&amp;lt;/b&amp;gt;: Specifies that your module should always dynamically autoload by default.  You can tweak this to either never autoload or always autoload (without letting the user toggle).&lt;br /&gt;
*&amp;lt;b&amp;gt;required&amp;lt;/b&amp;gt;: Specifies whether or not this extension is '''required''' by your plugin.  If for some reason your extension fails to load (or is not found), the plugin will also fail to load.  This is changeable if you wish to override the default behavior.&lt;br /&gt;
&lt;br /&gt;
You can copy and paste this example, but remember to modify the following portions:&lt;br /&gt;
*&amp;lt;b&amp;gt;__ext_geoip&amp;lt;/b&amp;gt;: Change the &amp;quot;geoip&amp;quot; portion to your own unique variable name.&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;quot;GeoIP&amp;lt;/b&amp;gt;: Change the GeoIP portion to your extension's name.  This should match the name you chose as &amp;lt;tt&amp;gt;SMEXT_CONF_NAME&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*&amp;lt;b&amp;gt;&amp;quot;geoip.ext&amp;quot;&amp;lt;/b&amp;gt;: Change this to your extension's file name, without the .dll/.so portion.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Global Autoloading==&lt;br /&gt;
To have your extension always autoload, you must create a ''.autoload'' file in the &amp;lt;tt&amp;gt;extensions&amp;lt;/tt&amp;gt; folder.  For example, to have the &amp;lt;tt&amp;gt;threader.ext.dll&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;threader.ext.so&amp;lt;/tt&amp;gt; extensions autoload, you'd create the following file in &amp;lt;tt&amp;gt;extensions&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;threader.autoload&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A few notes:&lt;br /&gt;
*This only works for extensions using the .ext.&amp;lt;platform&amp;gt; convention.  SourceMod cuts off the &amp;quot;.autoload&amp;quot; portion of the file, then adds on &amp;quot;.ext.dll&amp;quot; or &amp;quot;.ext.so&amp;quot; which will not work on custom files.&lt;br /&gt;
*The file does not need to contain anything, it simply needs to exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Conventions=&lt;br /&gt;
&lt;br /&gt;
==Designing API/Natives==&lt;br /&gt;
*Start interface names with the capital letter 'I'.&lt;br /&gt;
*Use a consistent naming convention.  SourceMod uses [http://msdn2.microsoft.com/en-us/library/ms229002.aspx Microsoft/Pascal] naming.  Avoid Java/Camel casing for both API and natives.&lt;br /&gt;
*When exposing interfaces, make sure your exposure defines start with &amp;lt;tt&amp;gt;SMINTERFACE_&amp;lt;/tt&amp;gt; and end with &amp;lt;tt&amp;gt;_NAME&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;_VERSION&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Naming==&lt;br /&gt;
*Logtags (&amp;lt;tt&amp;gt;SMEXT_CONF_LOGTAG&amp;lt;/tt&amp;gt;) should be short names (under 10 characters or so) in all capital letters.&lt;br /&gt;
*Your extension file name should never have &amp;lt;tt&amp;gt;_i486&amp;lt;/tt&amp;gt; or other unnecessary platform-specific notations in its name.&lt;br /&gt;
*Your extension file name should always end in &amp;lt;tt&amp;gt;.ext.so&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;.ext.dll&amp;lt;/tt&amp;gt; depending on the platform.  The &amp;lt;tt&amp;gt;.ext.&amp;lt;/tt&amp;gt; is SourceMod convention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Setting up Visual Studio=&lt;br /&gt;
==Paths==&lt;br /&gt;
'''Visual Studio 2003''': Tools -&amp;gt; Options -&amp;gt; Projects, VC++ Directories&lt;br /&gt;
&lt;br /&gt;
'''Visual Studio 2005''': Tools -&amp;gt; Options -&amp;gt; Projects and Solutions -&amp;gt; VC++ Directories&lt;br /&gt;
&lt;br /&gt;
===Include Paths===&lt;br /&gt;
*SourceMod only:&lt;br /&gt;
**sdk\public\extensions&lt;br /&gt;
**sdk\public\sourcepawn&lt;br /&gt;
**sdk\public&lt;br /&gt;
*SourceMM (Note that sourcemm might be 'trunk' for you):&lt;br /&gt;
**sourcemm\core&lt;br /&gt;
**sourcemm\core\sourcehook&lt;br /&gt;
*HL2SDK:&lt;br /&gt;
**game\shared&lt;br /&gt;
**public\vstdlib&lt;br /&gt;
**public\tier1&lt;br /&gt;
**public\tier0&lt;br /&gt;
**public\engine&lt;br /&gt;
**public&lt;br /&gt;
**dlls&lt;br /&gt;
&lt;br /&gt;
===Link Paths===&lt;br /&gt;
*HL2SDK:&lt;br /&gt;
**lib\public for version 2005&lt;br /&gt;
**lib-vc7\public for version 2003&lt;br /&gt;
&lt;br /&gt;
==Compiler Options==&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; These options are set by default in the sample Extension SDK.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; These options should be set for every build (Release/Debug/others).&lt;br /&gt;
&lt;br /&gt;
For VS 2005, goto Project-&amp;gt;Properties.&lt;br /&gt;
&lt;br /&gt;
*General&lt;br /&gt;
**&amp;lt;tt&amp;gt;Character Set&amp;lt;/tt&amp;gt;: '''Use Multi-Byte Character Set'''&lt;br /&gt;
*C/C++&lt;br /&gt;
**General&lt;br /&gt;
***&amp;lt;tt&amp;gt;Detect 64-bit Portability Issues&amp;lt;/tt&amp;gt;: '''No'''&lt;br /&gt;
**Preprocessor&lt;br /&gt;
***&amp;lt;tt&amp;gt;Preprocessor Defines&amp;lt;/tt&amp;gt;: Add &amp;lt;tt&amp;gt;_CRT_SECURE_NO_DEPRECATE&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;_CRT_NONSTDC_NO_DEPRECATE&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;SOURCEMOD_BUILD&amp;lt;/tt&amp;gt;  and &amp;lt;tt&amp;gt;WIN32&amp;lt;/tt&amp;gt;&lt;br /&gt;
**Code Generation&lt;br /&gt;
***&amp;lt;tt&amp;gt;Runtime Library&amp;lt;/tt&amp;gt;: Multi-threaded or /MT (for Release), Multi-threaded Debug or /MTd (for Debug)&lt;br /&gt;
*Linker&lt;br /&gt;
**General&lt;br /&gt;
***&amp;lt;tt&amp;gt;Output File&amp;lt;/tt&amp;gt;: Change &amp;lt;tt&amp;gt;$(ProjectName)&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;$(ProjectName).ext&amp;lt;/tt&amp;gt;, or use your own custom string.&lt;br /&gt;
**Input&lt;br /&gt;
***&amp;lt;tt&amp;gt;Additional Dependencies&amp;lt;/tt&amp;gt;: &amp;lt;tt&amp;gt;tier0.lib tier1.lib vstdlib.lib&amp;lt;/tt&amp;gt; (for SourceMM attached extensions only)&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod]]&lt;br /&gt;
[[Category:SourceMod Development]]&lt;/div&gt;</summary>
		<author><name>Seta00</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Pawn_Tutorial&amp;diff=7487</id>
		<title>Pawn Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Pawn_Tutorial&amp;diff=7487"/>
		<updated>2010-01-14T01:56:11Z</updated>

		<summary type="html">&lt;p&gt;Seta00: &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;pawn&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;
new z = 1_000_000 // Pawn supports numbers like this. So big values are easier to read.&amp;lt;/pawn&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;pawn&amp;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.&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also do the following:&lt;br /&gt;
&amp;lt;pawn&amp;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.&amp;lt;/pawn&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;
&amp;lt;pawn&amp;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&amp;lt;/pawn&amp;gt;&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;pawn&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;
&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;
&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;
&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;
&lt;br /&gt;
//This is also totally invalid           &lt;br /&gt;
Players[-1] = 6&lt;br /&gt;
&lt;br /&gt;
new a = 3&lt;br /&gt;
//This is also totally invalid.  &lt;br /&gt;
//a must be a constant number.&lt;br /&gt;
new BadArray[a]&lt;br /&gt;
&lt;br /&gt;
//So this is valid:&lt;br /&gt;
const b = 3&lt;br /&gt;
new GoodArray[b]&lt;br /&gt;
&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]&amp;lt;/pawn&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;pawn&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&amp;lt;/pawn&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;pawn&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[33] = {true, ...}&amp;lt;/pawn&amp;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;pawn&amp;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;&amp;lt;/pawn&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;pawn&amp;gt;new myString[6]&lt;br /&gt;
myString[0] = 'H'&lt;br /&gt;
myString[1] = 'e'&lt;br /&gt;
myString[2] = 'l'&lt;br /&gt;
myString[3] = 'l'&lt;br /&gt;
myString[4] = 'o'&lt;br /&gt;
myString[5] = 0&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{qnotice|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;pawn&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;)&amp;lt;/pawn&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;pawn&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 &amp;lt;/pawn&amp;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;pawn&amp;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()&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also declare functions to take parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;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;
b = 12&lt;br /&gt;
new c = add_two_numbers(a,b)&lt;br /&gt;
//c will now be equal to 17.&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&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;pawn&amp;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;
}&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&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;pawn&amp;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.&amp;lt;/pawn&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;pawn&amp;gt;bad_function(const array[])&lt;br /&gt;
{&lt;br /&gt;
   array[0] = 0&lt;br /&gt;
}&amp;lt;/pawn&amp;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;pawn&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)&amp;lt;/pawn&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;pawn&amp;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 7&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&amp;lt;/pawn&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;pawn&amp;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.&amp;lt;/pawn&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;pawn&amp;gt;a--          //returns 4, post decrement&lt;br /&gt;
--a          //returns 4, pre decrement&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a++ essentially trims down this code:&lt;br /&gt;
&amp;lt;pawn&amp;gt;a = a + 1&amp;lt;/pawn&amp;gt;&lt;br /&gt;
However, there is another way to write lines of code of this form:&lt;br /&gt;
&amp;lt;pawn&amp;gt;a = a OP y&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Where OP is a math operator.  It can be shortened to:&lt;br /&gt;
&amp;lt;pawn&amp;gt;a OP= x&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Observe:&lt;br /&gt;
&amp;lt;pawn&amp;gt;a += 1       //This sets a to a + 1&lt;br /&gt;
a -= b       //This sets a to a - b&lt;br /&gt;
a *= 0       //This multiplies a by 0&lt;br /&gt;
a /= 2       //This divides a by 2.&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&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;pawn&amp;gt;(1 || 0)                    //true, since one of the values is true.&lt;br /&gt;
(1 || 2)                    //true&lt;br /&gt;
(true || false)             //true&lt;br /&gt;
(false || false)            //false&lt;br /&gt;
(true || true)              //true&amp;lt;/pawn&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;pawn&amp;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)&amp;lt;/pawn&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;pawn&amp;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)&amp;lt;/pawn&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;pawn&amp;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;
//This is the &amp;quot;bitwise complement&amp;quot; operator, which performs a !(not) on each bit.&lt;br /&gt;
(~(9))&amp;lt;/pawn&amp;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;pawn&amp;gt;if (a == 5)&lt;br /&gt;
{&lt;br /&gt;
   a = 6&lt;br /&gt;
}&amp;lt;/pawn&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;pawn&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;/pawn&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;pawn&amp;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) {}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
Note that array comparisons have restrictions. This is invalid:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;my arrayOne[3]&lt;br /&gt;
my arrayTwo[3]&lt;br /&gt;
if (arrayOne == arrayTwo) {&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You must do:&lt;br /&gt;
&amp;lt;pawn&amp;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])) {&amp;lt;/pawn&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;pawn&amp;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;/pawn&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;pawn&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;/pawn&amp;gt;&lt;br /&gt;
Multiple conditions are also possible in pawn:&lt;br /&gt;
&amp;lt;pawn&amp;gt;//Example of an multiple switch statement&lt;br /&gt;
switch (a)&lt;br /&gt;
{&lt;br /&gt;
    case 1, 2, 3:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 1 or 2 or 3&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    case 4, 5, 6:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 4 or 5 or6&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    case 7, 8, 9:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if a is equal to 7 or 8 or 9&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;/pawn&amp;gt;&lt;br /&gt;
You could use the switch statement also for ranges:&lt;br /&gt;
&amp;lt;pawn&amp;gt;//Example of an range switch statement&lt;br /&gt;
switch (a)&lt;br /&gt;
{&lt;br /&gt;
    case 0 .. 50:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if 0 &amp;lt;= a &amp;lt;= 50&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    case 51 .. 100:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if 51 &amp;lt;= a &amp;lt;= 100&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    case 101 .. 200:&lt;br /&gt;
    {&lt;br /&gt;
       //This code will run if 101 &amp;lt;= a &amp;lt;= 200&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;/pawn&amp;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;pawn&amp;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;
}&amp;lt;/pawn&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;pawn&amp;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;
}&amp;lt;/pawn&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;pawn&amp;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;
}&amp;lt;/pawn&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;pawn&amp;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]&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&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;pawn&amp;gt;new sum = sum_of_array(BigArray[2], 3)&amp;lt;/pawn&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;pawn&amp;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;/pawn&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;pawn&amp;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 [2][6] contains &amp;quot;friend&amp;quot;&lt;br /&gt;
*/&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&amp;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;pawn&amp;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&amp;lt;/pawn&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;pawn&amp;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&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also change how much memory your script uses.&lt;br /&gt;
&amp;lt;pawn&amp;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.&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also specify whether semicolon usage is required to terminate a line of code (by default it is not required). &lt;br /&gt;
&amp;lt;pawn&amp;gt;#pragma semicolon 1&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also change the control character( amxx std: '^' )&lt;br /&gt;
&amp;lt;pawn&amp;gt;#pragma ctrlchar '\'&lt;br /&gt;
//this sets the control character to backslash( c/c++/c#/java/... std )&lt;br /&gt;
// now you have to use the \ instead of ^&lt;br /&gt;
// e.g. &amp;quot;this is ^&amp;quot;:D^&amp;quot; &amp;quot; must be now &amp;quot; this is \&amp;quot;:D\&amp;quot; &amp;quot;&amp;lt;/pawn&amp;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 Pawn documentation and language guide, go this website: http://www.compuphase.com/pawn/Pawn_Language_Guide.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_Language_Guide.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>Seta00</name></author>
		
	</entry>
</feed>