Merge pull request #108 from Nextra/inc-doc
Update include documentation (mainly amxmodx.inc)
This commit is contained in:
		| @@ -15,29 +15,46 @@ | |||||||
| #include <amxmodx_version> | #include <amxmodx_version> | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * This is the buffer size AMX Mod X uses internally to retrieve strings from plugins. |  * Internal AMXX buffer size for string retrieval. | ||||||
|  * Most natives that take strings as arguments will implicitly truncate those to this maximum length. |  | ||||||
|  * This has been raised to the current value with AMXX 1.8.3. Previously the limit was 3072. |  | ||||||
|  * |  * | ||||||
|  * @note This is here mainly for documentation purposes. By default plugins don't even have enough  |  * @note This is the buffer size AMX Mod X uses internally to retrieve strings | ||||||
|  *       memory available to create an array of this size. You probably should not use this to  |  *       from plugins. Most natives that take strings as arguments will | ||||||
|  *       actually *declare* a buffer unless you *absolutely* have to. Look at #pragma dynamic  |  *       implicitly truncate them to this maximum length. This has been raised | ||||||
|  *       to increase a plugins available memory. |  *       to the current value with AMXX 1.8.3. Previously the limit was 3072. | ||||||
|  |  * @note This is here mainly for documentation purposes. By default plugins | ||||||
|  |  *       don't have enough memory available to allocate an array of this size. | ||||||
|  |  *       You probably should not use this to actually declare a buffer unless | ||||||
|  |  *       you *absolutely* have to. Look at #pragma dynamic to increase a plugins | ||||||
|  |  *       available memory. | ||||||
|  */ |  */ | ||||||
| #define MAX_STRING_LENGTH 16384 | #define MAX_STRING_LENGTH 16384 | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * MAX_PLAYERS is not the same as MaxClients. |  * Defines and constants related to the maximum number of clients. | ||||||
|  * MAX_PLAYERS is a hardcoded value as an upper limit.  MaxClients changes based on the server. |  * | ||||||
|  |  * @note  MAX_PLAYERS is not the same as MaxClients. MAX_PLAYERS is a hardcoded | ||||||
|  |  *        value as an upper limit, used mainly to declare arrays big enough for | ||||||
|  |  *        all possible server situations. MaxClients changes based on the | ||||||
|  |  *        server the plugin is deployed on.. | ||||||
|  */ |  */ | ||||||
| #define MAX_PLAYERS 33 /* Maximum number of players AMX Mod X supports */ | #define MAX_PLAYERS 33 /* Maximum number of players AMX Mod X supports */ | ||||||
| #define MAX_NAME_LENGTH 32	/* Maximum buffer required to store a client name */ |  | ||||||
|  |  | ||||||
| public stock const MaxClients;	/* Maximum number of players the server supports (dynamic) */ | public stock const MaxClients; /* Maximum number of players the server supports */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * The maximum buffer size required to store a clients name. | ||||||
|  |  */ | ||||||
|  | #define MAX_NAME_LENGTH 32 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * π | ||||||
|  |  */ | ||||||
| #define M_PI 3.1415926535 | #define M_PI 3.1415926535 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @section Admin privilege and authentication constants | ||||||
|  |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Admin level constants |  * Admin level constants | ||||||
|  */ |  */ | ||||||
| @@ -67,6 +84,9 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
| #define ADMIN_ADMIN         (1<<24) /* flag "y" */ | #define ADMIN_ADMIN         (1<<24) /* flag "y" */ | ||||||
| #define ADMIN_USER          (1<<25) /* flag "z" */ | #define ADMIN_USER          (1<<25) /* flag "z" */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Admin authentication behavior flags | ||||||
|  |  */ | ||||||
| #define FLAG_KICK           (1<<0)  /* flag "a" */ | #define FLAG_KICK           (1<<0)  /* flag "a" */ | ||||||
| #define FLAG_TAG            (1<<1)  /* flag "b" */ | #define FLAG_TAG            (1<<1)  /* flag "b" */ | ||||||
| #define FLAG_AUTHID         (1<<2)  /* flag "c" */ | #define FLAG_AUTHID         (1<<2)  /* flag "c" */ | ||||||
| @@ -74,6 +94,10 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
| #define FLAG_NOPASS         (1<<4)  /* flag "e" */ | #define FLAG_NOPASS         (1<<4)  /* flag "e" */ | ||||||
| #define FLAG_CASE_SENSITIVE (1<<10) /* flag "k" */ | #define FLAG_CASE_SENSITIVE (1<<10) /* flag "k" */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @endsection | ||||||
|  |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Return codes |  * Return codes | ||||||
|  */ |  */ | ||||||
| @@ -82,7 +106,7 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
| #define PLUGIN_HANDLED_MAIN 2   /* to use in client_command(), continue all plugins but stop the command */ | #define PLUGIN_HANDLED_MAIN 2   /* to use in client_command(), continue all plugins but stop the command */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * CVAR constants for register_cvar() |  * CVAR flags for register_cvar() | ||||||
|  */ |  */ | ||||||
| #define FCVAR_ARCHIVE       1   /* set to cause it to be saved to vars.rc */ | #define FCVAR_ARCHIVE       1   /* set to cause it to be saved to vars.rc */ | ||||||
| #define FCVAR_USERINFO      2   /* changes the client's info string */ | #define FCVAR_USERINFO      2   /* changes the client's info string */ | ||||||
| @@ -165,7 +189,7 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
| #define HIT_RIGHTLEG    7 | #define HIT_RIGHTLEG    7 | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * @section Constants for emit_sound() |  * @section emit_sound() constants | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -201,6 +225,14 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
|  */ |  */ | ||||||
| #define VOL_NORM        1.0 | #define VOL_NORM        1.0 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Sound behavior constants | ||||||
|  |  */ | ||||||
|  | #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 | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * @endsection |  * @endsection | ||||||
|  */ |  */ | ||||||
| @@ -225,6 +257,10 @@ public stock const MaxClients;	/* Maximum number of players the server supports | |||||||
| #define LANG_SERVER     0 | #define LANG_SERVER     0 | ||||||
| #define LANG_PLAYER     -1 | #define LANG_PLAYER     -1 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @section Client print native constants | ||||||
|  |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Destination types for client_print() |  * Destination types for client_print() | ||||||
|  */ |  */ | ||||||
| @@ -259,7 +295,15 @@ enum | |||||||
| }; | }; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Render for set_user_rendering() |  * @endsection | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @section Entity rendering constants | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Rendering modes (i.e. for set_user_rendering()) | ||||||
|  */ |  */ | ||||||
| enum | enum | ||||||
| { | { | ||||||
| @@ -272,7 +316,7 @@ enum | |||||||
| }; | }; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Fx for set_user_rendering() |  * Rendering fx (i.e. for set_user_rendering()) | ||||||
|  */ |  */ | ||||||
| enum | enum | ||||||
| { | { | ||||||
| @@ -299,6 +343,10 @@ enum | |||||||
| 	kRenderFxClampMinScale,     /* Keep this sprite from getting very small (SPRITES only!) */ | 	kRenderFxClampMinScale,     /* Keep this sprite from getting very small (SPRITES only!) */ | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @endsection | ||||||
|  |  */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Type for force_unmodified() |  * Type for force_unmodified() | ||||||
|  */ |  */ | ||||||
| @@ -336,8 +384,14 @@ enum | |||||||
| #define AMX_FLAG_BROWSE     0x4000  /* busy browsing */ | #define AMX_FLAG_BROWSE     0x4000  /* busy browsing */ | ||||||
| #define AMX_FLAG_RELOC      0x8000  /* jump/call addresses relocated */ | #define AMX_FLAG_RELOC      0x8000  /* jump/call addresses relocated */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Invalid plugin id | ||||||
|  |  */ | ||||||
| #define INVALID_PLUGIN_ID   -1 | #define INVALID_PLUGIN_ID   -1 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Menu and menu item status codes | ||||||
|  |  */ | ||||||
| #define MENU_TIMEOUT    -4 | #define MENU_TIMEOUT    -4 | ||||||
| #define MENU_EXIT       -3 | #define MENU_EXIT       -3 | ||||||
| #define MENU_BACK       -2 | #define MENU_BACK       -2 | ||||||
| @@ -346,6 +400,9 @@ enum | |||||||
| #define ITEM_ENABLED    1 | #define ITEM_ENABLED    1 | ||||||
| #define ITEM_DISABLED   2 | #define ITEM_DISABLED   2 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * AMX error codes | ||||||
|  |  */ | ||||||
| #define AMX_ERR_NATIVE      10 | #define AMX_ERR_NATIVE      10 | ||||||
| #define AMX_ERR_MEMACCESS   5 | #define AMX_ERR_MEMACCESS   5 | ||||||
| #define AMX_ERR_NONE        0 | #define AMX_ERR_NONE        0 | ||||||
| @@ -358,22 +415,34 @@ enum | |||||||
| #define AMX_ERR_PARAMS      25 | #define AMX_ERR_PARAMS      25 | ||||||
| #define AMX_ERR_GENERAL     27 | #define AMX_ERR_GENERAL     27 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Generic invalid handle value | ||||||
|  |  */ | ||||||
| #define INVALID_HANDLE      -1 | #define INVALID_HANDLE      -1 | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @section Plugin forward related constants | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Stop types for plugin forwards | ||||||
|  |  */ | ||||||
| #define ET_IGNORE       0   //ignore return val | #define ET_IGNORE       0   //ignore return val | ||||||
| #define ET_STOP         1   //stop on PLUGIN_HANDLED | #define ET_STOP         1   //stop on PLUGIN_HANDLED | ||||||
| #define ET_STOP2        2   //same, except return biggest | #define ET_STOP2        2   //same, except return biggest | ||||||
| #define ET_CONTINUE     3   //no stop, return biggest | #define ET_CONTINUE     3   //no stop, return biggest | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Parameter types for plugin forwards | ||||||
|  |  */ | ||||||
| #define FP_CELL         0 | #define FP_CELL         0 | ||||||
| #define FP_FLOAT        1 | #define FP_FLOAT        1 | ||||||
| #define FP_STRING       2 | #define FP_STRING       2 | ||||||
| #define FP_ARRAY        4 | #define FP_ARRAY        4 | ||||||
|  |  | ||||||
| #define SND_SPAWNING		(1<<8)		// we're spawing, used in some cases for ambients  | /** | ||||||
| #define SND_STOP		(1<<5)		// stop sound |  * @endsection | ||||||
| #define SND_CHANGE_VOL		(1<<6)		// change sound vol |  */ | ||||||
| #define SND_CHANGE_PITCH	(1<<7)		// change sound pitch |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * LibType constants |  * LibType constants | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -14,23 +14,28 @@ | |||||||
| #define _cellarray_included | #define _cellarray_included | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * These arrays are intended to be used for a form of global storage without  |  * Cellarray tag declaration | ||||||
|  * requiring a #define that needs to be increased each time a person needs more  |  * | ||||||
|  * storage. |  * @note These dynamic arrays are intended to be used for a form of global | ||||||
|  * These are not designed to be used as a replacement for normal arrays, as |  *       storage without requiring a #define that needs to be increased each | ||||||
|  * normal arrays are faster and should be used whenever possible. |  *       time the plugin author requires more storage. These are not designed | ||||||
|  |  *       to be a full replacement for normal arrays, as those are faster and | ||||||
|  |  *       should be used whenever possible. | ||||||
|  |  * @note Plugins are responsible for freeing all Array handles they acquire, | ||||||
|  |  *       including those from ArrayClone. Failing to free handles will result | ||||||
|  |  *       in the plugin and AMXX leaking memory. | ||||||
|  */ |  */ | ||||||
|   |  | ||||||
| enum Array | enum Array | ||||||
| { | { | ||||||
| 	Invalid_Array = 0 | 	Invalid_Array = 0 | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Given a maximum string size (including the null terminator),  |  * Returns the number of cells required to fit a string of the specified size | ||||||
|  * returns the number of cells required to fit that string. |  * (including the null terminator). | ||||||
|  * |  * | ||||||
|  * @param size          Number of bytes. |  * @param size          Number of bytes. | ||||||
|  |  * | ||||||
|  * @return              Minimum number of cells required to fit the byte count. |  * @return              Minimum number of cells required to fit the byte count. | ||||||
|  */ |  */ | ||||||
| stock ByteCountToCells(size) | stock ByteCountToCells(size) | ||||||
| @@ -45,412 +50,474 @@ stock ByteCountToCells(size) | |||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Creates a handle to a dynamically sized array. |  * Creates a handle to a dynamically sized array. | ||||||
|  * It is very important that the cellsize you provide matches up with the buffer sizes |  | ||||||
|  * that you pass with subsequent Array{Get,Set,Push} calls. |  | ||||||
|  * |  * | ||||||
|  * @param cellsize      How many cells each entry in the array is. |  * @note It is very important that the provided cellsize matches up with the | ||||||
|  * @param reserved      How many blank entries are created immediately when the array is created.   |  *       buffer sizes that are passed with subsequent Array[Get|Set|Push] calls. | ||||||
|  *                      These entries are not valid to read from until called with ArraySet. |  * @note Initially the "reserved" parameter was intended to create blank entries | ||||||
|  |  *       that would immediately be usable with Array[Get|Set] functions. This | ||||||
|  |  *       functionality was never working as intended, and can now be achieved | ||||||
|  |  *       using ArrayResize(). | ||||||
|  |  * | ||||||
|  |  * @param cellsize      Size of each array entry in cells | ||||||
|  |  * @param reserved      Pre-allocates space in the array for the specified | ||||||
|  |  *                      number of items. The items are not valid to read or set | ||||||
|  |  *                      until they have actually been pushed into the array. | ||||||
|  * |  * | ||||||
|  * @return              Handle to the array. |  * @return              Handle to the array. | ||||||
|  */ |  */ | ||||||
| native Array:ArrayCreate(cellsize = 1, reserved = 0); | native Array:ArrayCreate(cellsize = 1, reserved = 32); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Clones an array, returning a new handle with the same size and data. |  * Clones an array, returning a new handle with the same size and data. | ||||||
|  * You must close it. |  | ||||||
|  * |  * | ||||||
|  * @param which         Array handle to be cloned. |  * @param which         Array handle | ||||||
|  * |  * | ||||||
|  * @return              New handle to the cloned array object on success, 0 on failure. |  * @return              Handle to the cloned array on success, 0 otherwise | ||||||
|  * @error               Invalid handle. |  * @error               If an invalid handle is provided an error will be | ||||||
|  |  *                      thrown. | ||||||
|  */ |  */ | ||||||
| native Array:ArrayClone(Array:which); | native Array:ArrayClone(Array:which); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Clears all entries from the array. |  * Clears all entries from the array. | ||||||
|  * |  * | ||||||
|  * @param which         The array to clear. |  * @param which         Array handle | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle. |  * @error               Invalid handle | ||||||
|  */ |  */ | ||||||
| native ArrayClear(Array:which); | native ArrayClear(Array:which); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns the number of elements in the array. |  * Returns the number of elements in the array. | ||||||
|  * |  * | ||||||
|  * @param which         The array to check. |  * @param which         Array handle | ||||||
|  * |  * | ||||||
|  * @return              How many elements are in the array. |  * @return              Number of elements in the array | ||||||
|  * @error               Invalid handle. |  * @error               If an invalid handle is provided an error will be | ||||||
|  |  *                      thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySize(Array:which); | native ArraySize(Array:which); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Resizes an array.  If the size is smaller than the current size, |  * Resizes an array. | ||||||
|  * the array is truncated. |  | ||||||
|  * |  * | ||||||
|  * @param which         Array handle. |  * @note If the size is smaller than the current array size the array is | ||||||
|  * @param newsize       New size. |  *       truncated and data lost. | ||||||
|  |  * | ||||||
|  |  * @param which         Array handle | ||||||
|  |  * @param newsize       New size | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or out of memory. |  * @error               If an invalid handle is provided or the resizing | ||||||
|  |  *                      operation runs out of memory, an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native bool:ArrayResize(Array:which, newsize); | native bool:ArrayResize(Array:which, newsize); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns data within an array.   |  * Retrieves an array of data from a cellarray. | ||||||
|  * Make sure the output buffer matches the size the array was created with! |  | ||||||
|  * |  * | ||||||
|  * @param which         The array to retrieve the item from. |  * @note If the size parameter is specified as -1 the output buffer has to match | ||||||
|  * @param item          The item to retrieve (zero-based). |  *       the size the array was created with. | ||||||
|  * @param output        The output buffer to write. |  * | ||||||
|  |  * @param which         Array handle | ||||||
|  |  * @param item          Item index in the array | ||||||
|  |  * @param output        Buffer to copy value to | ||||||
|  * @param size          If not set, assumes the buffer size is equal to the |  * @param size          If not set, assumes the buffer size is equal to the | ||||||
|  *                      cellsize.  Otherwise, the size passed is used. |  *                      cellsize. Otherwise, the specified size is used. | ||||||
|  * |  * | ||||||
|  * @return              Number of cells copied. |  * @return              Number of cells copied | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or index is provided an error will | ||||||
|  |  *                      be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayGetArray(Array:which, item, any:output[], size = -1); | native ArrayGetArray(Array:which, item, any:output[], size = -1); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns a single cell of data from an array.   |  * Returns a single cell of data from an array | ||||||
|  * |  * | ||||||
|  * @param which         The array to retrieve the item from. |  * @param which         Array handle | ||||||
|  * @param item          The item to retrieve (zero-based). |  * @param item          Item index in the array | ||||||
|  * @param block         Optionally specify which block to read from |  * @param block         If the array has a cellsize >1 this optionally specifies | ||||||
|  *                      (useful if the blocksize > 0). |  *                      which block to read from | ||||||
|  * @param asChar        Optionally read as a byte instead of a cell. |  * @param asChar        If true reads the value as a byte instead of a cell | ||||||
|  * |  * | ||||||
|  * @return              Value read. |  * @return              Integer value | ||||||
|  * @error               Invalid handle, invalid index, or invalid block. |  * @error               If an invalid handle, index or block is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native any:ArrayGetCell(Array:which, item, block = 0, bool:asChar = false); | native any:ArrayGetCell(Array:which, item, block = 0, bool:asChar = false); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns a string value from an array. |  * Returieves string data from an array. | ||||||
|  * |  * | ||||||
|  * @param which         The array to retrieve the item from. |  * @param which         Array handle | ||||||
|  * @param item          The item to retrieve (zero-based). |  * @param item          Item index in the array | ||||||
|  * @param output        The variable to store the value in. |  * @param output        Buffer to copy value to | ||||||
|  * @param size          Character size of the output buffer. |  * @param size          Maximum size of the buffer | ||||||
|  * |  * | ||||||
|  * @return              Number of characters copied. |  * @return              Number of characters copied | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayGetString(Array:which, item, output[], size); | native ArrayGetString(Array:which, item, output[], size); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Sets an item's data with that of a local buffer.   |  * Fills an item's data with the contents of an array. | ||||||
|  * The buffer size must match what the cellsize that the array was created with! |  | ||||||
|  * The item must already exist, use ArrayPushArray to create a new item within the array. |  | ||||||
|  * |  * | ||||||
|  * @param which         The array to set the item from within. |  * @note If the size parameter is specified as -1 the input buffer has to match | ||||||
|  * @param item          The item to set (zero-based). |  *       the size the array was created with. | ||||||
|  * @param input         The input buffer to store. |  * @note The item index must already be valid. Use ArrayPushArray to create | ||||||
|  |  *       a new array item in the cellarray. | ||||||
|  |  * | ||||||
|  |  * @param which         Array handle | ||||||
|  |  * @param item          Item index in the array | ||||||
|  |  * @param input         Array to copy to the cellarray | ||||||
|  * @param size          If not set, assumes the buffer size is equal to the |  * @param size          If not set, assumes the buffer size is equal to the | ||||||
|  *                      blocksize.  Otherwise, the size passed is used. |  *                      cellsize. Otherwise, the specified size is used. | ||||||
|  * |  * | ||||||
|  * @return              Number of cells copied. |  * @return              Number of cells copied | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySetArray(Array:which, item, const any:input[], size =-1); | native ArraySetArray(Array:which, item, const any:input[], size =-1); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Sets an array's single cell value.  Use this only on array that were created with a cellsize of 1! |  * Sets an item's data to a single cell value. | ||||||
|  * The item must already exist, use ArrayPushCell to create a new item within the array. |  | ||||||
|  * |  * | ||||||
|  * @param which         The array to set the item from within. |  * @note The item index must already be valid. Use ArrayPushArray to create | ||||||
|  * @param item          The item to set (zero-based). |  *       a new array item in the cellarray. | ||||||
|  * @param input         The value to set. |  * | ||||||
|  * @param block         Optionally specify which block to write to |  * @param which         Array handle | ||||||
|  *                      (useful if the blocksize > 0). |  * @param item          Item index in the array | ||||||
|  * @param asChar        Optionally set as a byte instead of a cell. |  * @param input         Value to set | ||||||
|  |  * @param block         If the array has a cellsize >1 this optionally specifies | ||||||
|  |  *                      which block to write to | ||||||
|  |  * @param asChar        If true writes the value as a byte instead of a cell | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle, invalid index, or invalid block. |  * @error               If an invalid handle, index or block is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySetCell(Array:which, item, any:input, block = 0, bool:asChar = false); | native ArraySetCell(Array:which, item, any:input, block = 0, bool:asChar = false); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Sets a string value from an array.   |  * Sets an item's data to a string value. | ||||||
|  * The stored string will be truncated if it is longer than the cellsize the array was created with! |  | ||||||
|  * The item must already exist, use ArrayPushString to create a new item within the array. |  | ||||||
|  * |  * | ||||||
|  * @param which         The array to set the item from within. |  * @note The input will be truncated if it is longer than the cellsize the array | ||||||
|  * @param item          The item to set (zero-based). |  *       was created with. | ||||||
|  * @param input         The string to set the item as. |  * @note The item index must already be valid. Use ArrayPushString to create | ||||||
|  |  *       a new array item in the cellarray. | ||||||
|  * |  * | ||||||
|  * @return              Number of characters copied. |  * @param which         Array handle | ||||||
|  * @error               Invalid handle or invalid index. |  * @param item          Item index in the array | ||||||
|  |  * @param input         String to copy to the array | ||||||
|  |  * | ||||||
|  |  * @return              Number of characters copied | ||||||
|  |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySetString(Array:which, item, const input[]); | native ArraySetString(Array:which, item, const input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Creates a new item at the end of the array and sets its data with that of a local buffer.   |  * Creates a new item at the end of the cellarray and copies the provided array | ||||||
|  * The buffer size must match what the cellsize that the array was created with! |  * into it. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @note The input will be truncated if it is bigger than the cellsize the array | ||||||
|  * @param input         The input buffer to store. |  *       was created with. | ||||||
|  * @param size          If not set, the number of elements copied from the array |  | ||||||
|  *                      will be equal to the blocksize.  If set higher than the  |  | ||||||
|  *                      blocksize, the operation will be truncated. |  | ||||||
|  * |  * | ||||||
|  * @return              Index of the new entry. |  * @param which         Array handle | ||||||
|  * @error               Invalid handle or out of memory. |  * @param input         Array to copy to the cellarray | ||||||
|  |  * @param size          If not set, assumes the buffer size is equal to the | ||||||
|  |  *                      cellsize. Otherwise, the specified size is used. | ||||||
|  |  * | ||||||
|  |  * @return              Index of the new entry | ||||||
|  |  * @error               If an invalid handle is provided or the resizing | ||||||
|  |  *                      operation runs out of memory, an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayPushArray(Array:which, const any:input[], size = -1); | native ArrayPushArray(Array:which, const any:input[], size = -1); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Creates a new item and sets the array's single cell value.   |  * Creates a new item ath the end of the array and sets the item's single cell | ||||||
|  * Use this only on array that were created with a cellsize of 1! |  * value. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @param which         Array handle | ||||||
|  * @param input         The value to set. |  * @param input         Value to set | ||||||
|  * |  * | ||||||
|  * @return              Index of the new entry. |  * @return              Index of the new entry | ||||||
|  * @error               Invalid handle or out of memory. |  * @error               If an invalid handle is provided or the resizing | ||||||
|  |  *                      operation runs out of memory, an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayPushCell(Array:which, any:input); | native ArrayPushCell(Array:which, any:input); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Creates a new element in the array and sets its value to the input buffer. |  * Creates a new item at the end of the array and copies the provided string | ||||||
|  * The stored string will be truncated if it is longer than the cellsize the array was created with! |  * into it. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @note The input will be truncated if it is longer than the cellsize the array | ||||||
|  * @param input         The string to set the item as. |  *       was created with. | ||||||
|  * |  * | ||||||
|  * @return              Index of the new entry. |  * @param which         Array handle | ||||||
|  * @error               Invalid handle or out of memory. |  * @param input         String to copy to the array | ||||||
|  |  * | ||||||
|  |  * @return              Index of the new entry | ||||||
|  |  * @error               If an invalid handle is provided or the resizing | ||||||
|  |  *                      operation runs out of memory, an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayPushString(Array:which, const input[]); | native ArrayPushString(Array:which, const input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item after the selected item.  All items beyond it get shifted up 1 space. |  * Creates a new item behind the specified item and copies the provided array | ||||||
|  * The buffer size must match what the cellsize that the array was created with! |  * into it. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @param which         Array handle | ||||||
|  * @param item          The item to insert after. |  * @param item          Item index in the array | ||||||
|  * @param input         The input buffer to store. |  * @param input         Array to copy to the cellarray | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertArrayAfter(Array:which, item, const any:input[]); | native ArrayInsertArrayAfter(Array:which, item, const any:input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item after the selected item.  All items beyond it get shifted up 1 space. |  * Creates a new item behind the specified item and sets the item's single cell | ||||||
|  * Use this only on an array that was created with a cellsize of 1! |  * value. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @param which         Array handle | ||||||
|  * @param item          The item to insert after. |  * @param item          Item index in the array | ||||||
|  * @param input         The value to set. |  * @param input         Value to set | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertCellAfter(Array:which, item, any:input); | native ArrayInsertCellAfter(Array:which, item, any:input); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item after the selected item.  All items beyond it get shifted up 1 space. |  * Creates a new item behind the specified item and copies the provided string | ||||||
|  * The stored string will be truncated if it is longer than the cellsize the array was created with! |  * into it. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @note The input will be truncated if it is longer than the cellsize the array | ||||||
|  * @param item          The item to insert after. |  *       was created with. | ||||||
|  * @param input         The value to set. |  * | ||||||
|  |  * @param which         Array handle | ||||||
|  |  * @param item          Item index in the array | ||||||
|  |  * @param input         String to copy to the array | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertStringAfter(Array:which, item, const input[]); | native ArrayInsertStringAfter(Array:which, item, const input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item before the selected item.  All items beyond it, and the selected item get shifted up 1 space. |  * Creates a new item in front of the specified item and copies the provided | ||||||
|  * The buffer size must match what the cellsize that the array was created with! |  * array into it. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @param which         Array handle | ||||||
|  * @param item          The item to insert before. |  * @param item          Item index in the array | ||||||
|  * @param input         The input buffer to store. |  * @param input         Array to copy to the cellarray | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertArrayBefore(Array:which, item, const any:input[]); | native ArrayInsertArrayBefore(Array:which, item, const any:input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item before the selected item.  All items beyond it, and the selected item get shifted up 1 space. |  * Creates a new item in front of the specified item and sets the item's single | ||||||
|  * Use this only on an array that was created with a cellsize of 1! |  * cell value. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @param which         Array handle | ||||||
|  * @param item          The item to insert after. |  * @param item          Item index in the array | ||||||
|  * @param input         The value to set. |  * @param input         Value to set | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertCellBefore(Array:which, item, const any:input); | native ArrayInsertCellBefore(Array:which, item, const any:input); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Inserts an item before the selected item.  All items beyond it, and the selected item get shifted up 1 space. |  * Creates a new item in front of the specified item and copies the provided | ||||||
|  * The stored string will be truncated if it is longer than the cellsize the array was created with! |  * string into it. All items beyond it get shifted up by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array to add the item to. |  * @note The input will be truncated if it is longer than the cellsize the array | ||||||
|  * @param item          The item to insert before. |  *       was created with. | ||||||
|  * @param input         The value to set. |  * | ||||||
|  |  * @param which         Array handle | ||||||
|  |  * @param item          Item index in the array | ||||||
|  |  * @param input         String to copy to the array | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayInsertStringBefore(Array:which, item, const input[]); | native ArrayInsertStringBefore(Array:which, item, const input[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Swaps the position of two items. |  * Swaps the position of two items. | ||||||
|  * |  * | ||||||
|  * @param which         The array that contains the items. |  * @param which         Array handle | ||||||
|  * @param item1         The first item to swap. |  * @param item1,item2   Item pair to swap | ||||||
|  * @param item2         The second item to swap. |  | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySwap(Array:which, item1, item2); | native ArraySwap(Array:which, item1, item2); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Deletes an item from the array.  All items beyond it get shifted down 1 space. |  * Deletes an item from the array. All items beyond it get shifted down by one. | ||||||
|  * |  * | ||||||
|  * @param which         The array that contains the item to delete. |  * @param which         Array handle | ||||||
|  * @param item          The item to delete. |  * @param item          Item to delete | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayDeleteItem(Array:which, item); | native ArrayDeleteItem(Array:which, item); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns the index for the first occurance of the provided string. If the string |  * Searches through the array and returns the index of the first occurence of | ||||||
|  * cannot be located, -1 will be returned. |  * the specified string. | ||||||
|  * |  * | ||||||
|  * @param which         Array handle. |  * @param which         Array handle | ||||||
|  * @param item          String to search for. |  * @param item          String to search for | ||||||
|  * |  * | ||||||
|  * @return              Array index, or -1 on failure. |  * @return              Array index on success, -1 if the string can't be found | ||||||
|  * @error               Invalid handle. |  * @error               Invalid handle. | ||||||
|  */ |  */ | ||||||
| native ArrayFindString(Array:which, const item[]); | native ArrayFindString(Array:which, const item[]); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Returns the index for the first occurance of the provided value. If the value |  * Searches through the array and returns the index of the first occurence of | ||||||
|  * cannot be located, -1 will be returned. |  * the specified value. | ||||||
|  * |  * | ||||||
|  * @param which         Array handle. |  * @param which         Array handle | ||||||
|  * @param item          Value to search for. |  * @param item          Value to search for | ||||||
|  * |  * | ||||||
|  * @return              Array index, or -1 on failure. |  * @return              Array index on success, -1 if the value can't be found | ||||||
|  * @error               Invalid handle. |  * @error               If an invalid handle is provided an error will be | ||||||
|  |  *                      thrown. | ||||||
|  */ |  */ | ||||||
| native ArrayFindValue(Array:which, any:item); | native ArrayFindValue(Array:which, any:item); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Creates a handle that is passable to a format compliant routine for printing as a string (with the %a format option).   |  * Creates a special handle that can be passed to a string format routine for | ||||||
|  * It is suggested to pass the function directly as a parameter to the format routine. |  * printing as a string (with the %a format option). | ||||||
|  * The array contents must be a null-terminated string! |  | ||||||
|  * |  * | ||||||
|  * An example usage:  client_print(id, print_chat, "%a", ArrayGetStringHandle(MessageArray, i)); |  * @note It is recommended to pass the function as a parameter to the format | ||||||
|  |  *       routine directly. The array item must contain a null-terminated string! | ||||||
|  |  * @note Do not save or otherwise use the handles returned by this function. | ||||||
|  |  * @note Example usage: | ||||||
|  |  *       console_print(id, "%a", ArrayGetStringHandle(MessageArray, i)); | ||||||
|  * |  * | ||||||
|  * @param which         The array the string is stored in. |  * @param which         Array handle | ||||||
|  * @param item          Which item to print the string value of. |  * @param item          Item to retrieve handle of | ||||||
|  * |  * | ||||||
|  * @return              Handle to the item directly.  Do not use or save stale handles. |  * @return              Handle to the item | ||||||
|  * @error               Invalid handle or invalid index. |  * @error               If an invalid handle or an invalid index is provided an | ||||||
|  |  *                      error will be thrown. | ||||||
|  */ |  */ | ||||||
| native DoNotUse:ArrayGetStringHandle(Array:which, item); | native DoNotUse:ArrayGetStringHandle(Array:which, item); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Destroys the array, and resets the handle to 0 to prevent accidental usage after it is destroyed. |  * Destroys the array and frees its memory. | ||||||
|  * |  * | ||||||
|  * @param which         The array to destroy. |  * @note The function automatically sets the variable passed to it to 0 to aid | ||||||
|  |  *       in preventing accidental usage after destroy. | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @param which         Array to destroy | ||||||
|  * @error               Invalid handle. |  * | ||||||
|  |  * @return              1 if the array was destroyed, 0 if nothing had to be | ||||||
|  |  *                      destroyed (invalid handle) | ||||||
|  */ |  */ | ||||||
| native ArrayDestroy(&Array:which); | native ArrayDestroy(&Array:which); | ||||||
|  |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Similar to sorting.inc's CustomSort. |  * Similar to sorting.inc's CustomSort, the sorting algorithm then uses the | ||||||
|  * The sorting algorithm then uses your comparison function to sort the data. |  * custom comparison function to sort the data. | ||||||
|  * The function is called in the following manner: |  * | ||||||
|  |  * @note The function is called in the following manner: | ||||||
|  * |  * | ||||||
|  * public MySortFunc(Array:array, item1, item2, const data[], data_size) |  * public MySortFunc(Array:array, item1, item2, const data[], data_size) | ||||||
|  * |  * | ||||||
|  *  array           - Array handle in its current un-sorted state. |  *  array           - Array handle in its current un-sorted state | ||||||
|  *  item1, item2    - Current item pair being compared |  *  item1, item2    - Current item pair being compared | ||||||
|  *  data[]          - Extra data array you passed to the sort func. |  *  data[]          - Extra data array passed to the sort func | ||||||
|  *  data_size       - Size of extra data you passed to the sort func. |  *  data_size       - Size of extra data | ||||||
|  * |  * | ||||||
|  * Your function should return: |  * @note The comparison function should return: | ||||||
|  *         -1 if item1 should go before item2 |  *         -1 if item1 should go before item2 | ||||||
|  *          0 if item1 and item2 are equal |  *          0 if item1 and item2 are equal | ||||||
|  *          1 if item1 should go after item2 |  *          1 if item1 should go after item2 | ||||||
|  * |  * | ||||||
|  * Note that the parameters after item2 are all optional and you do not need to specify them. |  * @note All parameters after item2 are optional and do not need to be specified | ||||||
|  * Note that unlike the sorting.inc versions, the array passed to the callback is not in mid-sorted state. |  *       and used. | ||||||
|  |  * @note Unlike the sorting.inc version, the array passed to the callback is not | ||||||
|  |  *       in mid-sorted state. | ||||||
|  * |  * | ||||||
|  * @param array         Array handle. |  * @param array         Array handle | ||||||
|  * @param comparefunc   A callback function used for comparison. |  * @param comparefunc   Callback function used for comparison | ||||||
|  * @param data          Extra data array you passed to the sort func. |  * @param data          Extra data that is passed through to the callback | ||||||
|  * @param data_size     Size of extra data you passed to the sort func. |  * @param data_size     Size of extra data | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle or invalid callback. |  * @error               If an invalid handle or an invalid callback is provided | ||||||
|  |  *                      an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySort(Array:array, const comparefunc[], data[]="", data_size=0); | native ArraySort(Array:array, const comparefunc[], data[]="", data_size=0); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * A faster version of ArraySort.  |  * A faster version of ArraySort, the sorting algorithm then uses the custom | ||||||
|  * The sorting algorithm then uses your comparison function to sort the data. |  * comparison function to sort the data. | ||||||
|  * |  * | ||||||
|  * The advantage of this native is that the Array elements being compared are  |  * @note The advantage of this function is that the data of the elements being | ||||||
|  * directly passed into your function, instead of the item indexes that are passed by ArraySort.  |  *       compared is directly passed to the function, instead of the item | ||||||
|  * This removes the need for calling ArrayGet[Cell|String|Array] every time before being  |  *       indexes that are passed by ArraySort. This removes the need for calling | ||||||
|  * able to compare the elements. |  *       ArrayGet[Cell|String|Array] every time before being able to compare the | ||||||
|  |  *       elements. | ||||||
|  * |  * | ||||||
|  * For Arrays with a cellsize of 1 (used for storing integers and floats),  |  * @note For Arrays with a cellsize of 1 (used for storing integers and floats), | ||||||
|  *       the function is called in the following manner: |  *       the function is called in the following manner: | ||||||
|  * |  * | ||||||
|  * public MySortFunc(Array:array, elem1, elem2, const data[], data_size) |  * public MySortFunc(Array:array, elem1, elem2, const data[], data_size) | ||||||
|  * |  * | ||||||
|  *  array           - Array handle in its current un-sorted state. |  *  array           - Array handle in its current un-sorted state | ||||||
|  *  elem1, elem2    - Current element pair being compared |  *  elem1, elem2    - Current element pair being compared | ||||||
|  *  data[]          - Extra data array you passed to the sort func. |  *  data[]          - Extra data array passed to the sort func | ||||||
|  *  data_size       - Size of extra data you passed to the sort func. |  *  data_size       - Size of extra data | ||||||
|  * |  * | ||||||
|  * For Arrays with a cellsize larger than 1 (used for storing arrays and strings), |  * @note For Arrays with a cellsize larger than 1 (used for storing arrays and | ||||||
|  * the function is called in the following manner: |  *       strings), the function is called in the following manner: | ||||||
|  * |  * | ||||||
|  * public MySortFunc(Array:array, elem1[], elem2[], const data[], data_size) |  * public MySortFunc(Array:array, elem1[], elem2[], const data[], data_size) | ||||||
|  * |  * | ||||||
|  *  array               - Array handle in its current un-sorted state. |  *  array               - Array handle in its current un-sorted state | ||||||
|  *  elem1[], elem2[]    - Current element pair being compared |  *  elem1[], elem2[]    - Current element pair being compared | ||||||
|  *  data[]              - Extra data array you passed to the sort func. |  *  data[]              - Extra data array passed to the sort func | ||||||
|  *  data_size           - Size of extra data you passed to the sort func. |  *  data_size           - Size of extra data | ||||||
|  * |  * | ||||||
|  * |  * | ||||||
|  * In both cases your function should return: |  * @note The comparison function should return: | ||||||
|  *         -1 if elem1 should go before elem2 |  *         -1 if elem1 should go before elem2 | ||||||
|  *          0 if elem1 and elem2 are equal |  *          0 if elem1 and elem2 are equal | ||||||
|  *          1 if elem1 should go after elem2 |  *          1 if elem1 should go after elem2 | ||||||
|  * |  * | ||||||
|  * Note that the parameters after elem2 are all optional and you do not need to specify them. |  * @note All parameters after item2 are optional and do not need to be specified | ||||||
|  * Note that unlike the sorting.inc versions, the array passed to the callback is not in mid-sorted state. |  *       and used. | ||||||
|  |  * @note Unlike the sorting.inc version, the array passed to the callback is not | ||||||
|  |  *       in mid-sorted state. | ||||||
|  * |  * | ||||||
|  * @param array         Array handle. |  * @param array         Array handle | ||||||
|  * @param comparefunc   A callback function used for comparison. |  * @param comparefunc   Callback function used for comparison | ||||||
|  * @param data          Extra data array you passed to the sort func. |  * @param data          Extra data that is passed through to the callback | ||||||
|  * @param data_size     Size of extra data you passed to the sort func. |  * @param data_size     Size of extra data | ||||||
|  * |  * | ||||||
|  * @noreturn |  * @noreturn | ||||||
|  * @error               Invalid handle, invalid callback or out of memory. |  * @error               If an invalid handle or an invalid callback is provided | ||||||
|  |  *                      an error will be thrown. | ||||||
|  */ |  */ | ||||||
| native ArraySortEx(Array:array, const comparefunc[], data[]="", data_size=0); | native ArraySortEx(Array:array, const comparefunc[], data[]="", data_size=0); | ||||||
|   | |||||||
| @@ -19,9 +19,9 @@ | |||||||
| /** | /** | ||||||
|  * Ham return types. |  * Ham return types. | ||||||
|  * |  * | ||||||
|  * Return these from hooks to disable calling the target function. |  * @note Return these from hooks to disable calling the target function. | ||||||
|  * Numbers match up with fakemeta's FMRES_* for clarity.  They are interchangable. |  *       Numbers match up with fakemeta's FMRES_* for clarity. They are | ||||||
|  * 0 (or no return) is also interpretted as HAM_IGNORED. |  *       interchangable. 0 (or no return) is also interpretted as HAM_IGNORED. | ||||||
|  */ |  */ | ||||||
| #define HAM_IGNORED		1	/**< Calls target function, returns normal value */ | #define HAM_IGNORED		1	/**< Calls target function, returns normal value */ | ||||||
| #define HAM_HANDLED		2	/**< Tells the module you did something, still calls target function and returns normal value */ | #define HAM_HANDLED		2	/**< Tells the module you did something, still calls target function and returns normal value */ | ||||||
| @@ -29,24 +29,21 @@ | |||||||
| #define HAM_SUPERCEDE	4	/**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ | #define HAM_SUPERCEDE	4	/**< Block the target call, and use your return value (if applicable) (Set with SetHamReturn*()) */ | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * A few notes about all of the following functions: |  * List of virtual functions made available through the hamsandwich module. | ||||||
|  *   - Not all functions will do as you expect on all mods. |  | ||||||
|  *     If a function does not do what you would believe it should |  | ||||||
|  *     DO NOT file a bug report, you will be ignored. |  | ||||||
|  * |  * | ||||||
|  *   - Passing invalid parameters has potential to crash the server |  * @note Not all functions will do as you expect on all mods. If a function does | ||||||
|  *     So be careful, and adequately test! |  *       not do what you would believe it should DO NOT file a bug report, you | ||||||
|  * |  *       will be ignored. | ||||||
|  *   - All functions take (and pass) a "this" index as the first param. |  * @note Passing invalid parameters has potential to crash the server, so be | ||||||
|  |  *       careful, and test carefully and adequately! | ||||||
|  |  * @note All functions take (and pass) a "this" index as the first param. | ||||||
|  *       This is the entity from which the function is being executed on. |  *       This is the entity from which the function is being executed on. | ||||||
|  * |  * @note All functions and forwards (eg: {Register,Execute}Ham[B]) require | ||||||
|  *   - All functions and forwards (eg: {Register,Execute}Ham[B]) require |  | ||||||
|  *       the mod to have the pev and base keys in addition to the function |  *       the mod to have the pev and base keys in addition to the function | ||||||
|  *       keys for the corresponding mod/operating system in hamdata.ini |  *       keys for the corresponding mod/operating system in hamdata.ini | ||||||
|  * |  * @note Some functions that return booleans may need to be logically ANDed | ||||||
|  *   - Some functions that return booleans may need to be logically ANDed |  *       to get the desired results because the mod will return the full integer | ||||||
|  *     to get the results desired.  e.g: if (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF != 0) { // true.. } |  *       value. E.g.: (ExecuteHam(Ham_TS_IsObjective, this) & 0x0000FFFF) != 0 | ||||||
|  *     because the module will return the full integer value. |  | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| enum Ham | enum Ham | ||||||
| @@ -3736,7 +3733,7 @@ enum Ham | |||||||
| }; | }; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * Ham errors types. |  * Ham error types. | ||||||
|  */ |  */ | ||||||
| enum HamError | enum HamError | ||||||
| { | { | ||||||
| @@ -3749,8 +3746,7 @@ enum HamError | |||||||
| }; | }; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * To be used with [Get|Set]HamItemInfo. |  * Constants for usage with [Get|Set]HamItemInfo | ||||||
|  * Ham prefix to avoid collision. :( |  | ||||||
|  */ |  */ | ||||||
| enum HamItemInfo | enum HamItemInfo | ||||||
| { | { | ||||||
|   | |||||||
| @@ -16,7 +16,9 @@ | |||||||
| #endif | #endif | ||||||
| #define _hlsdk_const_included | #define _hlsdk_const_included | ||||||
|  |  | ||||||
| // pev(entity, pev_button) or pev(entity, pev_oldbuttons) values | /** | ||||||
|  |  * pev(entity, pev_button) or pev(entity, pev_oldbuttons) values | ||||||
|  |  */ | ||||||
| #define IN_ATTACK                       (1<<0) | #define IN_ATTACK                       (1<<0) | ||||||
| #define IN_JUMP                         (1<<1) | #define IN_JUMP                         (1<<1) | ||||||
| #define IN_DUCK                         (1<<2) | #define IN_DUCK                         (1<<2) | ||||||
| @@ -34,7 +36,9 @@ | |||||||
| #define IN_ALT1                         (1<<14) | #define IN_ALT1                         (1<<14) | ||||||
| #define IN_SCORE                        (1<<15)     // Used by client.dll for when scoreboard is held down | #define IN_SCORE                        (1<<15)     // Used by client.dll for when scoreboard is held down | ||||||
|  |  | ||||||
| // pev(entity, pev_flags) values | /** | ||||||
|  |  * pev(entity, pev_flags) values | ||||||
|  |  */ | ||||||
| #define FL_FLY                          (1<<0)      // Changes the SV_Movestep() behavior to not need to be on ground | #define FL_FLY                          (1<<0)      // Changes the SV_Movestep() behavior to not need to be on ground | ||||||
| #define FL_SWIM                         (1<<1)      // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) | #define FL_SWIM                         (1<<1)      // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) | ||||||
| #define FL_CONVEYOR                     (1<<2) | #define FL_CONVEYOR                     (1<<2) | ||||||
| @@ -66,12 +70,16 @@ | |||||||
| #define FL_KILLME                       (1<<30)     // This entity is marked for death -- This allows the engine to kill ents at the appropriate time | #define FL_KILLME                       (1<<30)     // This entity is marked for death -- This allows the engine to kill ents at the appropriate time | ||||||
| #define FL_DORMANT                      (1<<31)     // Entity is dormant, no updates to client | #define FL_DORMANT                      (1<<31)     // Entity is dormant, no updates to client | ||||||
|  |  | ||||||
| // engfunc(EngFunc_WalkMove, entity, Float:yaw, Float:dist, iMode) iMode values | /** | ||||||
|  |  * engfunc(EngFunc_WalkMove, entity, Float:yaw, Float:dist, iMode) iMode values | ||||||
|  |  */ | ||||||
| #define WALKMOVE_NORMAL                 0           // Normal walkmove | #define WALKMOVE_NORMAL                 0           // Normal walkmove | ||||||
| #define WALKMOVE_WORLDONLY              1           // Doesn't hit ANY entities, no matter what the solid type | #define WALKMOVE_WORLDONLY              1           // Doesn't hit ANY entities, no matter what the solid type | ||||||
| #define WALKMOVE_CHECKONLY              2           // Move, but don't touch triggers | #define WALKMOVE_CHECKONLY              2           // Move, but don't touch triggers | ||||||
|  |  | ||||||
| // pev(entity, pev_movetype) values | /** | ||||||
|  |  * pev(entity, pev_movetype) values | ||||||
|  |  */ | ||||||
| #define MOVETYPE_NONE                   0           // Never moves | #define MOVETYPE_NONE                   0           // Never moves | ||||||
| #define MOVETYPE_WALK                   3           // Player only - moving on the ground | #define MOVETYPE_WALK                   3           // Player only - moving on the ground | ||||||
| #define MOVETYPE_STEP                   4           // Gravity, special edge handling -- monsters use this | #define MOVETYPE_STEP                   4           // Gravity, special edge handling -- monsters use this | ||||||
| @@ -85,28 +93,38 @@ | |||||||
| #define MOVETYPE_FOLLOW                 12          // Track movement of aiment | #define MOVETYPE_FOLLOW                 12          // Track movement of aiment | ||||||
| #define MOVETYPE_PUSHSTEP               13          // BSP model that needs physics/world collisions (uses nearest hull for world collision) | #define MOVETYPE_PUSHSTEP               13          // BSP model that needs physics/world collisions (uses nearest hull for world collision) | ||||||
|  |  | ||||||
| // pev(entity, pev_solid) values | /** | ||||||
| // NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves |  * pev(entity, pev_solid) values | ||||||
| // SOLID only effects OTHER entities colliding with this one when they move - UGH! |  * | ||||||
|  |  * @note Some movetypes will cause collisions independent of SOLID_NOT and | ||||||
|  |  *       SOLID_TRIGGER when the entity moves. SOLID only effects OTHER entities | ||||||
|  |  *       colliding with this one when they move - UGH! | ||||||
|  |  */ | ||||||
| #define SOLID_NOT                       0           // No interaction with other objects | #define SOLID_NOT                       0           // No interaction with other objects | ||||||
| #define SOLID_TRIGGER                   1           // Touch on edge, but not blocking | #define SOLID_TRIGGER                   1           // Touch on edge, but not blocking | ||||||
| #define SOLID_BBOX                      2           // Touch on edge, block | #define SOLID_BBOX                      2           // Touch on edge, block | ||||||
| #define SOLID_SLIDEBOX                  3           // Touch on edge, but not an onground | #define SOLID_SLIDEBOX                  3           // Touch on edge, but not an onground | ||||||
| #define SOLID_BSP                       4           // BSP clip, touch on edge, block | #define SOLID_BSP                       4           // BSP clip, touch on edge, block | ||||||
|  |  | ||||||
| // pev(entity, pev_deadflag) values | /** | ||||||
|  |  * pev(entity, pev_deadflag) values | ||||||
|  |  */ | ||||||
| #define DEAD_NO                         0           // Alive | #define DEAD_NO                         0           // Alive | ||||||
| #define DEAD_DYING                      1           // Playing death animation or still falling off of a ledge waiting to hit ground | #define DEAD_DYING                      1           // Playing death animation or still falling off of a ledge waiting to hit ground | ||||||
| #define DEAD_DEAD                       2           // Dead, lying still | #define DEAD_DEAD                       2           // Dead, lying still | ||||||
| #define DEAD_RESPAWNABLE                3 | #define DEAD_RESPAWNABLE                3 | ||||||
| #define DEAD_DISCARDBODY                4 | #define DEAD_DISCARDBODY                4 | ||||||
|  |  | ||||||
| // new Float:takedamage, pev(entity, pev_takedamage, takedamage) values | /** | ||||||
|  |  * new Float:takedamage, pev(entity, pev_takedamage, takedamage) values | ||||||
|  |  */ | ||||||
| #define DAMAGE_NO                       0.0 | #define DAMAGE_NO                       0.0 | ||||||
| #define DAMAGE_YES                      1.0 | #define DAMAGE_YES                      1.0 | ||||||
| #define DAMAGE_AIM                      2.0 | #define DAMAGE_AIM                      2.0 | ||||||
|  |  | ||||||
| // pev(entity, pev_effects) values | /** | ||||||
|  |  * pev(entity, pev_effects) values | ||||||
|  |  */ | ||||||
| #define EF_BRIGHTFIELD                  1           // Swirling cloud of particles | #define EF_BRIGHTFIELD                  1           // Swirling cloud of particles | ||||||
| #define EF_MUZZLEFLASH                  2           // Single frame ELIGHT on entity attachment 0 | #define EF_MUZZLEFLASH                  2           // Single frame ELIGHT on entity attachment 0 | ||||||
| #define EF_BRIGHTLIGHT                  4           // DLIGHT centered at entity origin | #define EF_BRIGHTLIGHT                  4           // DLIGHT centered at entity origin | ||||||
| @@ -119,9 +137,9 @@ | |||||||
| /** | /** | ||||||
|  * Spectating camera mode constants |  * Spectating camera mode constants | ||||||
|  * |  * | ||||||
| * Those constants are linked to differents camera mode available when you are spectating. |  * @note These constants are linked to different camera modes available when you | ||||||
| * (death or spectator team) |  *       are spectating (either dead or when in spectator team). Usually this is | ||||||
| * They are usually stored in pev_iuser1 field in Counter-Strike and Half-Life games. |  *       stored in the pev_iuser1 field in Counter-Strike and Half-Life games. | ||||||
|  */ |  */ | ||||||
| #define OBS_NONE                        0 | #define OBS_NONE                        0 | ||||||
| #define OBS_CHASE_LOCKED                1           // Locked Chase Cam | #define OBS_CHASE_LOCKED                1           // Locked Chase Cam | ||||||
| @@ -131,7 +149,9 @@ | |||||||
| #define OBS_MAP_FREE                    5           // Free Overview | #define OBS_MAP_FREE                    5           // Free Overview | ||||||
| #define OBS_MAP_CHASE                   6           // Chase Overview | #define OBS_MAP_CHASE                   6           // Chase Overview | ||||||
|  |  | ||||||
| // engfunc(EngFunc_PointContents, Float:origin) return values | /** | ||||||
|  |  * engfunc(EngFunc_PointContents, Float:origin) return values | ||||||
|  |  */ | ||||||
| #define CONTENTS_EMPTY                  -1 | #define CONTENTS_EMPTY                  -1 | ||||||
| #define CONTENTS_SOLID                  -2 | #define CONTENTS_SOLID                  -2 | ||||||
| #define CONTENTS_WATER                  -3 | #define CONTENTS_WATER                  -3 | ||||||
| @@ -152,7 +172,10 @@ | |||||||
| #define CONTENT_GRAVITY_FLYFIELD        -18 | #define CONTENT_GRAVITY_FLYFIELD        -18 | ||||||
| #define CONTENT_FOG                     -19 | #define CONTENT_FOG                     -19 | ||||||
|  |  | ||||||
| // Instant damage values for use with gmsgDamage 3rd value write_long(BIT) | /** | ||||||
|  |  * Instant damage values for use with the 3rd parameter of the "Damage" client | ||||||
|  |  * message. | ||||||
|  |  */ | ||||||
| #define DMG_GENERIC                     0           // Generic damage was done | #define DMG_GENERIC                     0           // Generic damage was done | ||||||
| #define DMG_CRUSH                       (1<<0)      // Crushed by falling or moving object | #define DMG_CRUSH                       (1<<0)      // Crushed by falling or moving object | ||||||
| #define DMG_BULLET                      (1<<1)      // Shot | #define DMG_BULLET                      (1<<1)      // Shot | ||||||
| @@ -180,61 +203,92 @@ | |||||||
| #define DMG_GRENADE                     (1<<24)     // Counter-Strike only - Hit by HE grenade | #define DMG_GRENADE                     (1<<24)     // Counter-Strike only - Hit by HE grenade | ||||||
| #define DMG_TIMEBASED                   (~(0x3fff)) // Mask for time-based damage | #define DMG_TIMEBASED                   (~(0x3fff)) // Mask for time-based damage | ||||||
|  |  | ||||||
| // The fNoMonsters parameter of EngFunc_TraceLine, EngFunc_TraceMonsterHull, EngFunc_TraceHull, and EngFunc_TraceSphere | /** | ||||||
|  |  * Valid constants for fNoMonsters parameter of EngFunc_TraceLine, | ||||||
|  |  * EngFunc_TraceMonsterHull, EngFunc_TraceHull and EngFunc_TraceSphere. | ||||||
|  |  */ | ||||||
| #define DONT_IGNORE_MONSTERS            0 | #define DONT_IGNORE_MONSTERS            0 | ||||||
| #define IGNORE_MONSTERS                 1 | #define IGNORE_MONSTERS                 1 | ||||||
| #define IGNORE_MISSILE                  2 | #define IGNORE_MISSILE                  2 | ||||||
| #define IGNORE_GLASS                    0x100 | #define IGNORE_GLASS                    0x100 | ||||||
|  |  | ||||||
| // The hullnumber paramater of EngFunc_TraceHull, EngFunc_TraceModel and DLLFunc_GetHullBounds | /** | ||||||
|  |  * The hullnumber paramater of EngFunc_TraceHull, EngFunc_TraceModel and | ||||||
|  |  * DLLFunc_GetHullBounds | ||||||
|  |  */ | ||||||
| #define HULL_POINT                      0 | #define HULL_POINT                      0 | ||||||
| #define HULL_HUMAN                      1 | #define HULL_HUMAN                      1 | ||||||
| #define HULL_LARGE                      2 | #define HULL_LARGE                      2 | ||||||
| #define HULL_HEAD                       3 | #define HULL_HEAD                       3 | ||||||
|  |  | ||||||
| // global_get(glb_trace_flags) | /** | ||||||
|  |  * global_get(glb_trace_flags) | ||||||
|  |  */ | ||||||
| #define FTRACE_SIMPLEBOX                (1<<0)      // Traceline with a simple box | #define FTRACE_SIMPLEBOX                (1<<0)      // Traceline with a simple box | ||||||
|  |  | ||||||
| // Used with get/set_es(es_handle, ES_eFlags, ...) (entity_state data structure) | /** | ||||||
|  |  * Used with get/set_es(es_handle, ES_eFlags, ...) (entity_state data structure) | ||||||
|  |  */ | ||||||
| #define EFLAG_SLERP                     1           // Do studio interpolation of this entity | #define EFLAG_SLERP                     1           // Do studio interpolation of this entity | ||||||
|  |  | ||||||
| // pev(entity, pev_spawnflags) values | /** | ||||||
| // Many of these flags apply to specific entities |  * @section pev(entity, pev_spawnflags) values | ||||||
| // func_train |  */ | ||||||
|  | /** | ||||||
|  |  * func_train | ||||||
|  |  */ | ||||||
| #define SF_TRAIN_WAIT_RETRIGGER         1 | #define SF_TRAIN_WAIT_RETRIGGER         1 | ||||||
| #define SF_TRAIN_START_ON               4           // Train is initially moving | #define SF_TRAIN_START_ON               4           // Train is initially moving | ||||||
| #define SF_TRAIN_PASSABLE               8           // Train is not solid -- used to make water trains | #define SF_TRAIN_PASSABLE               8           // Train is not solid -- used to make water trains | ||||||
|  |  | ||||||
| // func_wall_toggle | /** | ||||||
|  |  * func_wall_toggle | ||||||
|  |  */ | ||||||
| #define SF_WALL_START_OFF               0x0001 | #define SF_WALL_START_OFF               0x0001 | ||||||
|  |  | ||||||
| // func_converyor | /** | ||||||
|  |  * func_converyor | ||||||
|  |  */ | ||||||
| #define SF_CONVEYOR_VISUAL              0x0001 | #define SF_CONVEYOR_VISUAL              0x0001 | ||||||
| #define SF_CONVEYOR_NOTSOLID            0x0002 | #define SF_CONVEYOR_NOTSOLID            0x0002 | ||||||
|  |  | ||||||
| // func_button | /** | ||||||
|  |  * func_button | ||||||
|  |  */ | ||||||
| #define SF_BUTTON_DONTMOVE              1 | #define SF_BUTTON_DONTMOVE              1 | ||||||
| #define SF_BUTTON_TOGGLE                32          // Button stays pushed until reactivated | #define SF_BUTTON_TOGGLE                32          // Button stays pushed until reactivated | ||||||
| #define SF_BUTTON_SPARK_IF_OFF          64          // Button sparks in OFF state | #define SF_BUTTON_SPARK_IF_OFF          64          // Button sparks in OFF state | ||||||
| #define SF_BUTTON_TOUCH_ONLY            256         // Button only fires as a result of USE key. | #define SF_BUTTON_TOUCH_ONLY            256         // Button only fires as a result of USE key. | ||||||
|  |  | ||||||
| // func_rot_button | /** | ||||||
|  |  * func_rot_button | ||||||
|  |  */ | ||||||
| #define SF_ROTBUTTON_NOTSOLID           1 | #define SF_ROTBUTTON_NOTSOLID           1 | ||||||
|  |  | ||||||
| // env_global | /** | ||||||
|  |  * env_global | ||||||
|  |  */ | ||||||
| #define SF_GLOBAL_SET                   1           // Set global state to initial state on spawn | #define SF_GLOBAL_SET                   1           // Set global state to initial state on spawn | ||||||
|  |  | ||||||
| // multisource | /** | ||||||
|  |  * multisource | ||||||
|  |  */ | ||||||
| #define SF_MULTI_INIT                   1 | #define SF_MULTI_INIT                   1 | ||||||
|  |  | ||||||
| // momentary_rot_button | /** | ||||||
|  |  * momentary_rot_button | ||||||
|  |  */ | ||||||
| #define SF_MOMENTARY_DOOR               0x0001 | #define SF_MOMENTARY_DOOR               0x0001 | ||||||
|  |  | ||||||
| // button_target | /** | ||||||
|  |  * button_target | ||||||
|  |  */ | ||||||
| #define SF_BTARGET_USE                  0x0001 | #define SF_BTARGET_USE                  0x0001 | ||||||
| #define SF_BTARGET_ON                   0x0002 | #define SF_BTARGET_ON                   0x0002 | ||||||
|  |  | ||||||
| // func_door, func_water, func_door_rotating, momementary_door | /** | ||||||
|  |  * func_door, func_water, func_door_rotating, momementary_door | ||||||
|  |  */ | ||||||
| #define SF_DOOR_ROTATE_Y                0 | #define SF_DOOR_ROTATE_Y                0 | ||||||
| #define SF_DOOR_START_OPEN              1 | #define SF_DOOR_START_OPEN              1 | ||||||
| #define SF_DOOR_ROTATE_BACKWARDS        2 | #define SF_DOOR_ROTATE_BACKWARDS        2 | ||||||
| @@ -247,32 +301,46 @@ | |||||||
| #define SF_DOOR_NOMONSTERS              512         // Monster can't open | #define SF_DOOR_NOMONSTERS              512         // Monster can't open | ||||||
| #define SF_DOOR_SILENT                  0x80000000 | #define SF_DOOR_SILENT                  0x80000000 | ||||||
|  |  | ||||||
| // gibshooter | /** | ||||||
|  |  * gibshooter | ||||||
|  |  */ | ||||||
| #define SF_GIBSHOOTER_REPEATABLE        1           // Allows a gibshooter to be refired | #define SF_GIBSHOOTER_REPEATABLE        1           // Allows a gibshooter to be refired | ||||||
|  |  | ||||||
| // env_funnel | /** | ||||||
|  |  * env_funnel | ||||||
|  |  */ | ||||||
| #define SF_FUNNEL_REVERSE               1           // Funnel effect repels particles instead of attracting them | #define SF_FUNNEL_REVERSE               1           // Funnel effect repels particles instead of attracting them | ||||||
|  |  | ||||||
| // env_bubbles | /** | ||||||
|  |  * env_bubbles | ||||||
|  |  */ | ||||||
| #define SF_BUBBLES_STARTOFF             0x0001 | #define SF_BUBBLES_STARTOFF             0x0001 | ||||||
|  |  | ||||||
| // env_blood | /** | ||||||
|  |  * env_blood | ||||||
|  |  */ | ||||||
| #define SF_BLOOD_RANDOM                 0x0001 | #define SF_BLOOD_RANDOM                 0x0001 | ||||||
| #define SF_BLOOD_STREAM                 0x0002 | #define SF_BLOOD_STREAM                 0x0002 | ||||||
| #define SF_BLOOD_PLAYER                 0x0004 | #define SF_BLOOD_PLAYER                 0x0004 | ||||||
| #define SF_BLOOD_DECAL                  0x0008 | #define SF_BLOOD_DECAL                  0x0008 | ||||||
|  |  | ||||||
| // env_shake | /** | ||||||
|  |  * env_shake | ||||||
|  |  */ | ||||||
| #define SF_SHAKE_EVERYONE               0x0001      // Don't check radius | #define SF_SHAKE_EVERYONE               0x0001      // Don't check radius | ||||||
| #define SF_SHAKE_DISRUPT                0x0002      // Disrupt controls | #define SF_SHAKE_DISRUPT                0x0002      // Disrupt controls | ||||||
| #define SF_SHAKE_INAIR                  0x0004      // Shake players in air | #define SF_SHAKE_INAIR                  0x0004      // Shake players in air | ||||||
|  |  | ||||||
| // env_fade | /** | ||||||
|  |  * env_fade | ||||||
|  |  */ | ||||||
| #define SF_FADE_IN                      0x0001      // Fade in, not out | #define SF_FADE_IN                      0x0001      // Fade in, not out | ||||||
| #define SF_FADE_MODULATE                0x0002      // Modulate, don't blend | #define SF_FADE_MODULATE                0x0002      // Modulate, don't blend | ||||||
| #define SF_FADE_ONLYONE                 0x0004 | #define SF_FADE_ONLYONE                 0x0004 | ||||||
|  |  | ||||||
| // env_beam, env_lightning | /** | ||||||
|  |  * env_beam, env_lightning | ||||||
|  |  */ | ||||||
| #define SF_BEAM_STARTON                 0x0001 | #define SF_BEAM_STARTON                 0x0001 | ||||||
| #define SF_BEAM_TOGGLE                  0x0002 | #define SF_BEAM_TOGGLE                  0x0002 | ||||||
| #define SF_BEAM_RANDOM                  0x0004 | #define SF_BEAM_RANDOM                  0x0004 | ||||||
| @@ -284,16 +352,22 @@ | |||||||
| #define SF_BEAM_SHADEOUT                0x0100 | #define SF_BEAM_SHADEOUT                0x0100 | ||||||
| #define SF_BEAM_TEMPORARY               0x8000 | #define SF_BEAM_TEMPORARY               0x8000 | ||||||
|  |  | ||||||
| // env_sprite | /** | ||||||
|  |  * env_sprite | ||||||
|  |  */ | ||||||
| #define SF_SPRITE_STARTON               0x0001 | #define SF_SPRITE_STARTON               0x0001 | ||||||
| #define SF_SPRITE_ONCE                  0x0002 | #define SF_SPRITE_ONCE                  0x0002 | ||||||
| #define SF_SPRITE_TEMPORARY             0x8000 | #define SF_SPRITE_TEMPORARY             0x8000 | ||||||
|  |  | ||||||
| // env_message | /** | ||||||
|  |  * env_message | ||||||
|  |  */ | ||||||
| #define SF_MESSAGE_ONCE                 0x0001      // Fade in, not out | #define SF_MESSAGE_ONCE                 0x0001      // Fade in, not out | ||||||
| #define SF_MESSAGE_ALL                  0x0002      // Send to all clients | #define SF_MESSAGE_ALL                  0x0002      // Send to all clients | ||||||
|  |  | ||||||
| // env_explosion | /** | ||||||
|  |  * env_explosion | ||||||
|  |  */ | ||||||
| #define SF_ENVEXPLOSION_NODAMAGE        (1<<0)      // When set, ENV_EXPLOSION will not actually inflict damage | #define SF_ENVEXPLOSION_NODAMAGE        (1<<0)      // When set, ENV_EXPLOSION will not actually inflict damage | ||||||
| #define SF_ENVEXPLOSION_REPEATABLE      (1<<1)      // Can this entity be refired? | #define SF_ENVEXPLOSION_REPEATABLE      (1<<1)      // Can this entity be refired? | ||||||
| #define SF_ENVEXPLOSION_NOFIREBALL      (1<<2)      // Don't draw the fireball | #define SF_ENVEXPLOSION_NOFIREBALL      (1<<2)      // Don't draw the fireball | ||||||
| @@ -301,7 +375,9 @@ | |||||||
| #define SF_ENVEXPLOSION_NODECAL         (1<<4)      // Don't make a scorch mark | #define SF_ENVEXPLOSION_NODECAL         (1<<4)      // Don't make a scorch mark | ||||||
| #define SF_ENVEXPLOSION_NOSPARKS        (1<<5)      // Don't make a scorch mark | #define SF_ENVEXPLOSION_NOSPARKS        (1<<5)      // Don't make a scorch mark | ||||||
|  |  | ||||||
| // func_tank | /** | ||||||
|  |  * func_tank | ||||||
|  |  */ | ||||||
| #define SF_TANK_ACTIVE                  0x0001 | #define SF_TANK_ACTIVE                  0x0001 | ||||||
| #define SF_TANK_PLAYER                  0x0002 | #define SF_TANK_PLAYER                  0x0002 | ||||||
| #define SF_TANK_HUMANS                  0x0004 | #define SF_TANK_HUMANS                  0x0004 | ||||||
| @@ -310,43 +386,65 @@ | |||||||
| #define SF_TANK_CANCONTROL              0x0020 | #define SF_TANK_CANCONTROL              0x0020 | ||||||
| #define SF_TANK_SOUNDON                 0x8000 | #define SF_TANK_SOUNDON                 0x8000 | ||||||
|  |  | ||||||
| // grenade | /** | ||||||
|  |  * grenade | ||||||
|  |  */ | ||||||
| #define SF_DETONATE                     0x0001 | #define SF_DETONATE                     0x0001 | ||||||
|  |  | ||||||
| // item_suit | /** | ||||||
|  |  * item_suit | ||||||
|  |  */ | ||||||
| #define SF_SUIT_SHORTLOGON              0x0001 | #define SF_SUIT_SHORTLOGON              0x0001 | ||||||
|  |  | ||||||
| // game_score | /** | ||||||
|  |  * game_score | ||||||
|  |  */ | ||||||
| #define SF_SCORE_NEGATIVE               0x0001 | #define SF_SCORE_NEGATIVE               0x0001 | ||||||
| #define SF_SCORE_TEAM                   0x0002 | #define SF_SCORE_TEAM                   0x0002 | ||||||
|  |  | ||||||
| // game_text | /** | ||||||
|  |  * game_text | ||||||
|  |  */ | ||||||
| #define SF_ENVTEXT_ALLPLAYERS           0x0001 | #define SF_ENVTEXT_ALLPLAYERS           0x0001 | ||||||
|  |  | ||||||
| // game_team_master | /** | ||||||
|  |  * game_team_master | ||||||
|  |  */ | ||||||
| #define SF_TEAMMASTER_FIREONCE          0x0001 | #define SF_TEAMMASTER_FIREONCE          0x0001 | ||||||
| #define SF_TEAMMASTER_ANYTEAM           0x0002 | #define SF_TEAMMASTER_ANYTEAM           0x0002 | ||||||
|  |  | ||||||
| // game_team_set | /** | ||||||
|  |  * game_team_set | ||||||
|  |  */ | ||||||
| #define SF_TEAMSET_FIREONCE             0x0001 | #define SF_TEAMSET_FIREONCE             0x0001 | ||||||
| #define SF_TEAMSET_CLEARTEAM            0x0002 | #define SF_TEAMSET_CLEARTEAM            0x0002 | ||||||
|  |  | ||||||
| // game_player_hurt | /** | ||||||
|  |  * game_player_hurt | ||||||
|  |  */ | ||||||
| #define SF_PKILL_FIREONCE               0x0001 | #define SF_PKILL_FIREONCE               0x0001 | ||||||
|  |  | ||||||
| // game_counter | /** | ||||||
|  |  * game_counter | ||||||
|  |  */ | ||||||
| #define SF_GAMECOUNT_FIREONCE           0x0001 | #define SF_GAMECOUNT_FIREONCE           0x0001 | ||||||
| #define SF_GAMECOUNT_RESET              0x0002 | #define SF_GAMECOUNT_RESET              0x0002 | ||||||
|  |  | ||||||
| // game_player_equip | /** | ||||||
|  |  * game_player_equip | ||||||
|  |  */ | ||||||
| #define SF_PLAYEREQUIP_USEONLY          0x0001 | #define SF_PLAYEREQUIP_USEONLY          0x0001 | ||||||
|  |  | ||||||
| // game_player_team | /** | ||||||
|  |  * game_player_team | ||||||
|  |  */ | ||||||
| #define SF_PTEAM_FIREONCE               0x0001 | #define SF_PTEAM_FIREONCE               0x0001 | ||||||
| #define SF_PTEAM_KILL                   0x0002 | #define SF_PTEAM_KILL                   0x0002 | ||||||
| #define SF_PTEAM_GIB                    0x0004 | #define SF_PTEAM_GIB                    0x0004 | ||||||
|  |  | ||||||
| // func_trackchange | /** | ||||||
|  |  * func_trackchange | ||||||
|  |  */ | ||||||
| #define SF_PLAT_TOGGLE                  0x0001 | #define SF_PLAT_TOGGLE                  0x0001 | ||||||
| #define SF_TRACK_ACTIVATETRAIN          0x00000001 | #define SF_TRACK_ACTIVATETRAIN          0x00000001 | ||||||
| #define SF_TRACK_RELINK                 0x00000002 | #define SF_TRACK_RELINK                 0x00000002 | ||||||
| @@ -354,7 +452,9 @@ | |||||||
| #define SF_TRACK_STARTBOTTOM            0x00000008 | #define SF_TRACK_STARTBOTTOM            0x00000008 | ||||||
| #define SF_TRACK_DONT_MOVE              0x00000010 | #define SF_TRACK_DONT_MOVE              0x00000010 | ||||||
|  |  | ||||||
| // func_tracktrain | /** | ||||||
|  |  * func_tracktrain | ||||||
|  |  */ | ||||||
| #define SF_TRACKTRAIN_NOPITCH           0x0001 | #define SF_TRACKTRAIN_NOPITCH           0x0001 | ||||||
| #define SF_TRACKTRAIN_NOCONTROL         0x0002 | #define SF_TRACKTRAIN_NOCONTROL         0x0002 | ||||||
| #define SF_TRACKTRAIN_FORWARDONLY       0x0004 | #define SF_TRACKTRAIN_FORWARDONLY       0x0004 | ||||||
| @@ -368,44 +468,66 @@ | |||||||
| #define SF_CORNER_TELEPORT              0x002 | #define SF_CORNER_TELEPORT              0x002 | ||||||
| #define SF_CORNER_FIREONCE              0x004 | #define SF_CORNER_FIREONCE              0x004 | ||||||
|  |  | ||||||
| // trigger_push | /** | ||||||
|  |  * trigger_push | ||||||
|  |  */ | ||||||
| #define SF_TRIGGER_PUSH_START_OFF       2           // Spawnflag that makes trigger_push spawn turned OFF | #define SF_TRIGGER_PUSH_START_OFF       2           // Spawnflag that makes trigger_push spawn turned OFF | ||||||
|  |  | ||||||
| // trigger_hurt | /** | ||||||
|  |  * trigger_hurt | ||||||
|  |  */ | ||||||
| #define SF_TRIGGER_HURT_TARGETONCE      1           // Only fire hurt target once | #define SF_TRIGGER_HURT_TARGETONCE      1           // Only fire hurt target once | ||||||
| #define SF_TRIGGER_HURT_START_OFF       2           // Spawnflag that makes trigger_push spawn turned OFF | #define SF_TRIGGER_HURT_START_OFF       2           // Spawnflag that makes trigger_push spawn turned OFF | ||||||
| #define SF_TRIGGER_HURT_NO_CLIENTS      8           // Spawnflag that makes trigger_push spawn turned OFF | #define SF_TRIGGER_HURT_NO_CLIENTS      8           // Spawnflag that makes trigger_push spawn turned OFF | ||||||
| #define SF_TRIGGER_HURT_CLIENTONLYFIRE  16          // Trigger hurt will only fire its target if it is hurting a client | #define SF_TRIGGER_HURT_CLIENTONLYFIRE  16          // Trigger hurt will only fire its target if it is hurting a client | ||||||
| #define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32          // Only clients may touch this trigger | #define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32          // Only clients may touch this trigger | ||||||
|  |  | ||||||
| // trigger_auto | /** | ||||||
|  |  * trigger_auto | ||||||
|  |  */ | ||||||
| #define SF_AUTO_FIREONCE                0x0001 | #define SF_AUTO_FIREONCE                0x0001 | ||||||
|  |  | ||||||
| // trigger_relay | /** | ||||||
|  |  * trigger_relay | ||||||
|  |  */ | ||||||
| #define SF_RELAY_FIREONCE               0x0001 | #define SF_RELAY_FIREONCE               0x0001 | ||||||
|  |  | ||||||
| // multi_manager | /** | ||||||
|  |  * multi_manager | ||||||
|  |  */ | ||||||
| #define SF_MULTIMAN_CLONE               0x80000000 | #define SF_MULTIMAN_CLONE               0x80000000 | ||||||
| #define SF_MULTIMAN_THREAD              0x00000001 | #define SF_MULTIMAN_THREAD              0x00000001 | ||||||
|  |  | ||||||
| // env_render - Flags to indicate masking off various render parameters that are normally copied to the targets | /** | ||||||
|  |  * env_render | ||||||
|  |  * @note These are flags to indicate masking off various render parameters that | ||||||
|  |  *       are usually copied to the targets | ||||||
|  |  */ | ||||||
| #define SF_RENDER_MASKFX                (1<<0) | #define SF_RENDER_MASKFX                (1<<0) | ||||||
| #define SF_RENDER_MASKAMT               (1<<1) | #define SF_RENDER_MASKAMT               (1<<1) | ||||||
| #define SF_RENDER_MASKMODE              (1<<2) | #define SF_RENDER_MASKMODE              (1<<2) | ||||||
| #define SF_RENDER_MASKCOLOR             (1<<3) | #define SF_RENDER_MASKCOLOR             (1<<3) | ||||||
|  |  | ||||||
| // trigger_changelevel | /** | ||||||
|  |  * trigger_changelevel | ||||||
|  |  */ | ||||||
| #define SF_CHANGELEVEL_USEONLY          0x0002 | #define SF_CHANGELEVEL_USEONLY          0x0002 | ||||||
|  |  | ||||||
| // trigger_endsection | /** | ||||||
|  |  * trigger_endsection | ||||||
|  |  */ | ||||||
| #define SF_ENDSECTION_USEONLY           0x0001 | #define SF_ENDSECTION_USEONLY           0x0001 | ||||||
|  |  | ||||||
| // trigger_camera | /** | ||||||
|  |  * trigger_camera | ||||||
|  |  */ | ||||||
| #define SF_CAMERA_PLAYER_POSITION       1 | #define SF_CAMERA_PLAYER_POSITION       1 | ||||||
| #define SF_CAMERA_PLAYER_TARGET         2 | #define SF_CAMERA_PLAYER_TARGET         2 | ||||||
| #define SF_CAMERA_PLAYER_TAKECONTROL    4 | #define SF_CAMERA_PLAYER_TAKECONTROL    4 | ||||||
|  |  | ||||||
| // func_rotating | /** | ||||||
|  |  * func_rotating | ||||||
|  |  */ | ||||||
| #define SF_BRUSH_ROTATE_Y_AXIS          0 | #define SF_BRUSH_ROTATE_Y_AXIS          0 | ||||||
| #define SF_BRUSH_ROTATE_INSTANT         1 | #define SF_BRUSH_ROTATE_INSTANT         1 | ||||||
| #define SF_BRUSH_ROTATE_BACKWARDS       2 | #define SF_BRUSH_ROTATE_BACKWARDS       2 | ||||||
| @@ -417,29 +539,40 @@ | |||||||
| #define SF_BRUSH_ROTATE_MEDIUMRADIUS    256 | #define SF_BRUSH_ROTATE_MEDIUMRADIUS    256 | ||||||
| #define SF_BRUSH_ROTATE_LARGERADIUS     512 | #define SF_BRUSH_ROTATE_LARGERADIUS     512 | ||||||
|  |  | ||||||
| // triggers | /** | ||||||
|  |  * triggers | ||||||
|  |  */ | ||||||
| #define SF_TRIGGER_ALLOWMONSTERS        1           // Monsters allowed to fire this trigger | #define SF_TRIGGER_ALLOWMONSTERS        1           // Monsters allowed to fire this trigger | ||||||
| #define SF_TRIGGER_NOCLIENTS            2           // Players not allowed to fire this trigger | #define SF_TRIGGER_NOCLIENTS            2           // Players not allowed to fire this trigger | ||||||
| #define SF_TRIGGER_PUSHABLES            4           // Only pushables can fire this trigger | #define SF_TRIGGER_PUSHABLES            4           // Only pushables can fire this trigger | ||||||
|  |  | ||||||
| #define SF_TRIG_PUSH_ONCE               1 | #define SF_TRIG_PUSH_ONCE               1 | ||||||
| // func_breakable |  | ||||||
|  | /** | ||||||
|  |  * func_breakable | ||||||
|  |  */ | ||||||
| #define SF_BREAK_TRIGGER_ONLY           1           // May only be broken by trigger | #define SF_BREAK_TRIGGER_ONLY           1           // May only be broken by trigger | ||||||
| #define SF_BREAK_TOUCH                  2           // Can be 'crashed through' by running player (plate glass) | #define SF_BREAK_TOUCH                  2           // Can be 'crashed through' by running player (plate glass) | ||||||
| #define SF_BREAK_PRESSURE               4           // Can be broken by a player standing on it | #define SF_BREAK_PRESSURE               4           // Can be broken by a player standing on it | ||||||
| #define SF_BREAK_CROWBAR                256         // Instant break if hit with crowbar | #define SF_BREAK_CROWBAR                256         // Instant break if hit with crowbar | ||||||
|  |  | ||||||
| // func_pushable (it's also func_breakable, so don't collide with those flags) | /** | ||||||
|  |  * func_pushable (also func_breakable, so don't collide with those flags) | ||||||
|  |  */ | ||||||
| #define SF_PUSH_BREAKABLE               128 | #define SF_PUSH_BREAKABLE               128 | ||||||
|  |  | ||||||
| // light_spawn | /** | ||||||
|  |  * light_spawn | ||||||
|  |  */ | ||||||
| #define SF_LIGHT_START_OFF              1 | #define SF_LIGHT_START_OFF              1 | ||||||
| #define SPAWNFLAG_NOMESSAGE             1 | #define SPAWNFLAG_NOMESSAGE             1 | ||||||
| #define SPAWNFLAG_NOTOUCH               1 | #define SPAWNFLAG_NOTOUCH               1 | ||||||
| #define SPAWNFLAG_DROIDONLY             4 | #define SPAWNFLAG_DROIDONLY             4 | ||||||
| #define SPAWNFLAG_USEONLY               1           // Can't be touched, must be used (buttons) | #define SPAWNFLAG_USEONLY               1           // Can't be touched, must be used (buttons) | ||||||
|  |  | ||||||
| // Monster Spawnflags | /** | ||||||
|  |  * Monster Spawnflags | ||||||
|  |  */ | ||||||
| #define SF_MONSTER_WAIT_TILL_SEEN       1           // Spawnflag that makes monsters wait until player can see them before attacking | #define SF_MONSTER_WAIT_TILL_SEEN       1           // Spawnflag that makes monsters wait until player can see them before attacking | ||||||
| #define SF_MONSTER_GAG                  2           // No idle noises from this monster | #define SF_MONSTER_GAG                  2           // No idle noises from this monster | ||||||
| #define SF_MONSTER_HITMONSTERCLIP       4 | #define SF_MONSTER_HITMONSTERCLIP       4 | ||||||
| @@ -452,18 +585,30 @@ | |||||||
| #define SF_MONSTER_TURRET_STARTINACTIVE 64 | #define SF_MONSTER_TURRET_STARTINACTIVE 64 | ||||||
| #define SF_MONSTER_WAIT_UNTIL_PROVOKED  64          // Don't attack the player unless provoked | #define SF_MONSTER_WAIT_UNTIL_PROVOKED  64          // Don't attack the player unless provoked | ||||||
|  |  | ||||||
| // info_decal | /** | ||||||
|  |  * info_decal | ||||||
|  |  */ | ||||||
| #define SF_DECAL_NOTINDEATHMATCH        2048 | #define SF_DECAL_NOTINDEATHMATCH        2048 | ||||||
|  |  | ||||||
| // worldspawn | /** | ||||||
|  |  * worldspawn | ||||||
|  |  */ | ||||||
| #define SF_WORLD_DARK                   0x0001      // Fade from black at startup | #define SF_WORLD_DARK                   0x0001      // Fade from black at startup | ||||||
| #define SF_WORLD_TITLE                  0x0002      // Display game title at startup | #define SF_WORLD_TITLE                  0x0002      // Display game title at startup | ||||||
| #define SF_WORLD_FORCETEAM              0x0004      // Force teams | #define SF_WORLD_FORCETEAM              0x0004      // Force teams | ||||||
|  |  | ||||||
| // Set this bit on guns and stuff that should never respawn | /** | ||||||
|  |  * Set this bit on guns and stuff that should never respawn | ||||||
|  |  */ | ||||||
| #define SF_NORESPAWN                    (1<<30) | #define SF_NORESPAWN                    (1<<30) | ||||||
|  |  | ||||||
| // Valve Mod Weapon Constants | /** | ||||||
|  |  * @endsection | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Valve Mod Weapon Constants | ||||||
|  |  */ | ||||||
| #define HLI_HEALTHKIT       1 | #define HLI_HEALTHKIT       1 | ||||||
| #define HLI_ANTIDOTE        2 | #define HLI_ANTIDOTE        2 | ||||||
| #define HLI_SECURITY        3 | #define HLI_SECURITY        3 | ||||||
| @@ -501,7 +646,10 @@ | |||||||
| #define FEV_SERVER      (1<<5)  // Only send if the event was created on the server. | #define FEV_SERVER      (1<<5)  // Only send if the event was created on the server. | ||||||
| #define FEV_CLIENT      (1<<6)  // Only issue event client side ( from shared code ) | #define FEV_CLIENT      (1<<6)  // Only issue event client side ( from shared code ) | ||||||
|  |  | ||||||
| // These are caps bits to indicate what an object's capabilities (currently used for save/restore and level transitions) | /** | ||||||
|  |  * Cap bits to indicate what an object's capabilities are, currently used for | ||||||
|  |  * save/restore and level transitions. | ||||||
|  |  */ | ||||||
| #define FCAP_CUSTOMSAVE                 0x00000001 | #define FCAP_CUSTOMSAVE                 0x00000001 | ||||||
| #define FCAP_ACROSS_TRANSITION          0x00000002      // should transfer between transitions | #define FCAP_ACROSS_TRANSITION          0x00000002      // should transfer between transitions | ||||||
| #define FCAP_MUST_SPAWN                 0x00000004      // Spawn after restore | #define FCAP_MUST_SPAWN                 0x00000004      // Spawn after restore | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -64,7 +64,7 @@ native socket_send(_socket, const _data[], _length); | |||||||
| native socket_send2(_socket, const _data[], _length); | native socket_send2(_socket, const _data[], _length); | ||||||
|  |  | ||||||
| /* This function will return true if the state (buffer content) have changed within the last recieve or | /* This function will return true if the state (buffer content) have changed within the last recieve or | ||||||
| * the timeout, where timeout is a value in <EFBFBD>Seconds, (1 sec =1000000 <EFBFBD>sec).  | * the timeout, where timeout is a value in µSeconds, (1 sec =1000000 µsec). | ||||||
| * Use to check if new data is in your socket. */ | * Use to check if new data is in your socket. */ | ||||||
|  |  | ||||||
| native socket_change(_socket, _timeout=100000); | native socket_change(_socket, _timeout=100000); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user