AMX Mod X



XFactor Servers

The Core

[ main ] [ comments ]

The AMX Mod X core contains the native and "essential" scripting functions. Functions are rarely added to the core unless they fit into a specific category. The AMXx Core is maintained by PM OnoTo.

The core is broken up into multiple sections. By including "amxmodx.inc", you automatically include the subsections.
There are a number of constants in the Core, listed here:
"Variable" Constants:
#define AMXX_VERSION		//AMXx Version
#define AMXX_VERSION_NUM	//AMXx Version without the .
stock const AMXX_VERSION_STRN	//AMXx Version as string

#define M_PI 3.1415926535

Admin Level Constants:
#define ADMIN_ALL		0	//Everyone
#define ADMIN_IMMUNITY		1	//Flag "a", immunity
#define ADMIN_RESERVATION	2	//Flag "b", reservation
#define ADMIN_KICK		4	//Flag "c", kick
#define ADMIN_BAN		8	//Flag "d", ban
#define ADMIN_SLAY		16	//Flag "e", slay
#define ADMIN_MAP		32	//Flag "f", map change
#define ADMIN_CVAR		64	//Flag "g", cvar change
#define ADMIN_CFG		128	//Flag "h", config execution
#define ADMIN_CHAT		256	//Flag "i", chat
#define ADMIN_VOTE		512	//Flag "j", vote
#define ADMIN_PASSWORD		1024	//Flag "k", sv_password
#define ADMIN_RCON		2048	//Flag "l", rcon access
#define ADMIN_LEVEL_A		4096	//Flag "m", custom
#define ADMIN_LEVEL_B		8192	//Flag "n", custom
#define ADMIN_LEVEL_C		16384	//Flag "o", custom
#define ADMIN_LEVEL_D		32768	//Flag "p", custom
#define ADMIN_LEVEL_E		65536	//Flag "q", custom
#define ADMIN_LEVEL_F		131072	//Flag "r", custom
#define ADMIN_LEVEL_G		262144	//Flag "s", custom
#define ADMIN_LEVEL_H		524288	//Flag "t", custom
#define ADMIN_MENU		1048576	//Flag "u", menus
#define ADMIN_ADMIN		16777216	//Flag "y", default admin
#define ADMIN_USER		33554432	//Flag "z", default user

#define FLAG_KICK		1	//Auth flag "a", kick if no auth
#define FLAG_TAG		2	//Auth flag "b", auth by tag
#define FLAG_AUTHID		4	//Auth flag "c", auth by WON/Steam ID
#define FLAG_IP			8	//Auth flag "d", auth by IP address
#define FLAG_NOPASS		16	//Auth flag "e", don't require password

Return Codes:
//Plugin passes through operation.  Whatever called it continues.
#define PLUGIN_CONTINUE		0
//Plugin halts continued operation (plugins following in the plugins.ini won't be called).
//Whatever called it will eventually supercede.
#define PLUGIN_HANDLED		1
//Continue calling plugins but halt the operation
#define PLUGIN_HANDLED_MAIN	2

CVAR Constants:
#define FCVAR_ARCHIVE		1	//Gets saved to vars.rc
#define FCVAR_USERINFO		2	//Changes client's info string
#define FCVAR_SERVER		4	//Notifies players when changed
#define FCVAR_EXTDLL		8	//Defined by external DLL
#define FCVAR_CLIENTDLL		16	//Defined by client DLL
#define FCVAR_PROTECTED		32	//Contains a password/private info
#define FCVAR_SPONLY		64	//Cannot be changed by clients in multiplayer
#define FCVAR_PRINTABLEONLY	128	//Cannot contain unprintable characters
#define FCVAR_UNLOGGED		256	//Don't log changes if FCVAR_SERVER

Sound Constants:
//Sound Channels
#define CHAN_AUTO		0
#define CHAN_WEAPON		1
#define CHAN_VOICE		2
#define CHAN_ITEM		3
#define CHAN_BODY		4
#define CHAN_STREAM		5	//Stream channel from static or dynamic area
#define CHAN_STATIC		6	//Channel from the static area
#define CHAN_NETWORKVOICE_BASE	7	//Voice data coming across the network
#define CHAN_NETWORKVOICE_END	500	//Network voice data reserves slots

//Attenuation values
#define ATTN_NONE		0.00
#define ATTN_NORM		0.80
#define ATTN_IDLE		2.00
#define ATTN_STATIC		1.25

//Pitch values
#define PITCH_NORM		100
#define PITCH_LOW		95
#define PITCH_HIGH		120

//Volume values
#define VOL_NORM		1.0

//Sound Types
#define SND_SPAWNING		(1<<8)	// we're spawing, used in some cases for ambients 
#define SND_STOP		(1<<5)	// stop sound
#define SND_CHANGE_VOL		(1<<6)	// change sound vol
#define SND_CHANGE_PITCH	(1<<7)	// change sound pitch

HI Weapon Constants:
#define HIW_BERETTA		1
#define HIW_SPAS12		2
#define HIW_M4A1		3
#define HIW_MP5A4		4
#define HIW_MP5SD5		5
#define HIW_AK47		6
#define HIW_AKS74U		7
#define HIW_GLOCK		8
#define HIW_M11			9
#define HIW_M11SD		10
#define HIW_PSG1		11
#define HIW_ZASTAVA		12
#define HIW_M16A2		13
#define HIW_REMINGTON		14
#define HIW_NATOGREN		15
#define HIW_TANGOGREN		16
#define HIW_FLASHBANG		17

Menu Key Defines:
/* Menu keys */
#define MENU_KEY_1		(1<<0)
#define MENU_KEY_2		(1<<1)
#define MENU_KEY_3		(1<<2)
#define MENU_KEY_4		(1<<3)
#define MENU_KEY_5		(1<<4)
#define MENU_KEY_6		(1<<5)
#define MENU_KEY_7		(1<<6)
#define MENU_KEY_8		(1<<7)
#define MENU_KEY_9		(1<<8)
#define MENU_KEY_0		(1<<9)

Print Types:
/* Destination types for client_print() */
enum {
	print_notify = 1,
	print_console,
	print_chat,
	print_center,
}

/* Destination types for engclient_print() */
enum {
	engprint_console = 0,
	engprint_center,
	engprint_chat,
}

Unmodified Constants:
/* Type for force_unmodified() */
enum {
	force_exactfile = 0,		/* File on client must exactly match server's file */
	force_model_samebounds,		/* For model files only, the geometry must fit in the same bbox */
	force_model_specifybounds,	/* For model files only, the geometry must fit in the specified bbox */
}

Module Constants:
/* Status for get_module() */
enum {
	module_none = 0,
	module_query,
	module_badload,
	module_loaded,
	module_noinfo,
	module_noquery,
	module_noattach,
	module_old,
};

AMX Flag Constants:
#define AMX_FLAG_DEBUG    0x02  /* symbolic info. available */
#define AMX_FLAG_COMPACT  0x04  /* compact encoding */
#define AMX_FLAG_BYTEOPC  0x08  /* opcode is a byte (not a cell) */
#define AMX_FLAG_NOCHECKS 0x10  /* no array bounds checking; no STMT opcode */
#define AMX_FLAG_NTVREG 0x1000  /* all native functions are registered */
#define AMX_FLAG_JITC   0x2000  /* abstract machine is JIT compiled */
#define AMX_FLAG_BROWSE 0x4000  /* busy browsing */
#define AMX_FLAG_RELOC  0x8000  /* jump/call addresses relocated */

#define INVALID_PLUGIN_ID	-1

//These are for the new menu system
//Specifies which "magic/special" item was selected
#define MENU_EXIT	-3
#define MENU_BACK	-2
#define MENU_MORE	-1
//Returns the state of an item in an item display callback
#define ITEM_IGNORE	0
#define ITEM_ENABLED	1
#define ITEM_DISABLED	2

Message Constants:
//Destination types for message_begin()
#define MSG_BROADCAST		0	//Unreliable message to everyone
#define MSG_ONE			1	//Reliable message to one client
#define MSG_ALL			2	//Reliable message to everyone
#define MSG_INIT		3	//Write to the init string
#define MSG_PVS			4	//Ents in PVS of origin
#define MSG_PAS			5	//Ents in PAS of origin
#define MSG_PVS_R		6	//Reliable to PVS
#define MSG_PAS_R		7	//Reliable to PAS
#define MSG_ONE_UNRELIABLE	8	//Send to one client, but don't put in reliable stream
#define MSG_SPEC		9	//Sends to all spectator proxies

//Message types for message_begin()
#define SVC_TEMPENTITY		23
#define SVC_INTERMISSION	30
#define SVC_CDTRACK		32
#define SVC_WEAPONANIM		35
#define SVC_ROOMTYPE		37
#define SVC_ADDANGLE		38	//[vec3] add this angle to the view angle
#define SVC_NEWUSERMSG		39
#define SVC_HLTV		50

//Message flags for set_msg_block()
#define BLOCK_NOT                   0
#define BLOCK_ONCE                  1
#define BLOCK_SET                   2

// Used with get_msg_argtype() and set_msg_arg_
enum
{
	ARG_BYTE = 1,       /* int */
	ARG_CHAR,           /* int */
	ARG_SHORT,          /* int */
	ARG_LONG,           /* int */
	ARG_ANGLE,          /* float */
	ARG_COORD,          /* float */
	ARG_STRING,         /* string */
	ARG_ENTITY,         /* int */
}

// Temp entity message types for message_begin()
// (Check message_const.inc for examples of usage)
#define	TE_BEAMPOINTS               0        // Beam effect between two points
#define	TE_BEAMENTPOINT             1        // Beam effect between point and entity
#define	TE_GUNSHOT                  2        // Particle effect plus ricochet sound
#define	TE_EXPLOSION                3        // Additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
#define	TE_TAREXPLOSION             4        // Quake1 "tarbaby" explosion with sound
#define	TE_SMOKE                    5        // Alphablend sprite, move vertically 30 pps
#define	TE_TRACER                   6        // Tracer effect from point to point
#define	TE_LIGHTNING                7        // TE_BEAMPOINTS with simplified parameters
#define	TE_BEAMENTS                 8
#define	TE_SPARKS                   9        // 8 random tracers with gravity, ricochet sprite
#define	TE_LAVASPLASH               10       // Quake1 lava splash
#define	TE_TELEPORT                 11       // Quake1 teleport splash
#define TE_EXPLOSION2               12       // Quake1 colormaped (base palette) particle explosion with sound
#define TE_BSPDECAL                 13       // Decal from the .BSP file
#define TE_IMPLOSION                14       // Tracers moving toward a point
#define TE_SPRITETRAIL              15       // Line of moving glow sprites with gravity, fadeout, and collisions
#define TE_SPRITE                   17       // Additive sprite, plays 1 cycle
#define TE_BEAMSPRITE               18       // A beam with a sprite at the end
#define TE_BEAMTORUS                19       // Screen aligned beam ring, expands to max radius over lifetime
#define TE_BEAMDISK                 20       // Disk that expands to max radius over lifetime
#define TE_BEAMCYLINDER             21       // Cylinder that expands to max radius over lifetime
#define TE_BEAMFOLLOW               22       // Create a line of decaying beam segments until entity stops moving
#define TE_GLOWSPRITE               23
#define TE_BEAMRING                 24       // Connect a beam ring to two entities
#define TE_STREAK_SPLASH            25       // Oriented shower of tracers
#define TE_DLIGHT                   27       // Dynamic light, effect world, minor entity effect
#define TE_ELIGHT                   28       // Point entity light, no world effect
#define TE_TEXTMESSAGE              29
#define TE_LINE                     30
#define TE_BOX                      31
#define TE_KILLBEAM                 99       // Kill all beams attached to entity
#define TE_LARGEFUNNEL              100
#define	TE_BLOODSTREAM              101      // Particle spray
#define	TE_SHOWLINE                 102      // Line of particles every 5 units, dies in 30 seconds
#define TE_BLOOD                    103      // Particle spray
#define TE_DECAL                    104      // Decal applied to a brush entity (not the world)
#define TE_FIZZ                     105      // Create alpha sprites inside of entity, float upwards
#define TE_MODEL                    106      // Create a moving model that bounces and makes a sound when it hits
#define TE_EXPLODEMODEL             107      // Spherical shower of models, picks from set
#define TE_BREAKMODEL               108      // Box of models or sprites
#define TE_GUNSHOTDECAL             109      // Decal and ricochet sound
#define TE_SPRITE_SPRAY             110      // Spray of alpha sprites
#define TE_ARMOR_RICOCHET           111      // Quick spark sprite, client ricochet sound.
#define TE_PLAYERDECAL              112
#define TE_BUBBLES                  113      // Create alpha sprites inside of box, float upwards
#define TE_BUBBLETRAIL              114      // Create alpha sprites along a line, float upwards
#define TE_BLOODSPRITE              115      // Spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent)
#define TE_WORLDDECAL               116      // Decal applied to the world brush
#define TE_WORLDDECALHIGH           117      // Decal (with texture index > 256) applied to world brush
#define TE_DECALHIGH                118      // Same as TE_DECAL, but the texture index was greater than 256
#define TE_PROJECTILE               119      // Makes a projectile (like a nail) (this is a high-priority tent)
#define TE_SPRAY                    120      // Throws a shower of sprites or models
#define TE_PLAYERSPRITES            121      // Sprites emit from a player's bounding box (ONLY use for players!)
#define TE_PARTICLEBURST            122      // Very similar to lavasplash
#define TE_FIREFIELD                123      // Makes a field of fire
#define TE_PLAYERATTACHMENT         124      // Attaches a TENT to a player (this is a high-priority tent)
#define TE_KILLPLAYERATTACHMENTS    125      // Will expire all TENTS attached to a player.
#define TE_MULTIGUNSHOT             126      // Much more compact shotgun message
#define TE_USERTRACER               127      // Larger message than the standard tracer, but allows some customization.


User Contributed Notes

MSG_PVS - "Ents in PVS of org" (PVS=potentially visible set)
MSG_PAS - "Ents in PAS of org" (PAS=potentially audible set)
MSG_PVS_R - "Reliable to PVS"
MSG_PAS_R - "Reliable to PAS"



The old include for AMX Mod 0.9.x is "amxmod.inc".

If you include this instead, you will also include amxmodx.inc and forward compatible stocks add AMXx compatibility to any AMX plugin.





© Copyright 2003-2010 by the AMX Mod X Dev Team