Cvars: Moving cvars stuffs in its own files
cvars.cpp renamed to CvarManager.cpp all cvars natives moved to a new cvars.cpp file Pawn include is updated as wall.
This commit is contained in:
@ -105,20 +105,6 @@ public stock const MaxClients; /* Maximum number of players the server supports
|
||||
#define PLUGIN_HANDLED 1 /* stop other plugins */
|
||||
#define PLUGIN_HANDLED_MAIN 2 /* to use in client_command(), continue all plugins but stop the command */
|
||||
|
||||
/**
|
||||
* CVAR flags for register_cvar()
|
||||
*/
|
||||
#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_SERVER 4 /* Notifies players when changed */
|
||||
#define FCVAR_EXTDLL 8 /* Defined by external DLL */
|
||||
#define FCVAR_CLIENTDLL 16 /* Defined by the client dll */
|
||||
#define FCVAR_PROTECTED 32 /* It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value */
|
||||
#define FCVAR_SPONLY 64 /* This cvar cannot be changed by clients connected to a multiplayer server. */
|
||||
#define FCVAR_PRINTABLEONLY 128 /* This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). */
|
||||
#define FCVAR_UNLOGGED 256 /* If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log */
|
||||
#define FCVAR_NOEXTRAWHITEPACE 512 /* Strip trailing/leading white space from this cvar */
|
||||
|
||||
/**
|
||||
* IDs of weapons in CS
|
||||
*/
|
||||
|
@ -1404,159 +1404,6 @@ native amxclient_cmd(index, const command[], const arg1[]="", const arg2[]="");
|
||||
*/
|
||||
native server_cmd(const command[], any:...);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given string value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_string function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_string(const cvar[], const value[]);
|
||||
|
||||
/**
|
||||
* Returns if a cvar is registered on the server.
|
||||
*
|
||||
* @param cvar Cvar name to check
|
||||
*
|
||||
* @return 1 if the cvar exists, 0 otherwise
|
||||
*/
|
||||
native cvar_exists(const cvar[]);
|
||||
|
||||
/**
|
||||
* Removes specified flags from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Not permitted for the "amx_version", "amxmodx_version", "fun_version"
|
||||
* and "sv_cheats" cvars.
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function removes the flags using a bitwise-and operation.
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_flags function.
|
||||
*
|
||||
*
|
||||
* @param cvar Cvar name to remove flags from
|
||||
* @param flags Bitflag sum of flags to remove
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native remove_cvar_flags(const cvar[], flags=-1);
|
||||
|
||||
/**
|
||||
* Sets specified flags to a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Not permitted for the "amx_version", "amxmodx_version", "fun_version"
|
||||
* and "sv_cheats" cvars.
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function just adds the flags using a bitwise-or operation. After
|
||||
* it has run the flags may not exactly equal the specified bitflag sum.
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_flags function.
|
||||
*
|
||||
* @param cvar Cvar name to remove flags from
|
||||
* @param flags Bitflag sum of flags to set
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native set_cvar_flags(const cvar[], flags);
|
||||
|
||||
/**
|
||||
* Returns flags of a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_flags function.
|
||||
*
|
||||
* @param cvar Cvar name to retrieve flags from
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native get_cvar_flags(const cvar[]);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given float value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_float function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_float(const cvar[], Float:value);
|
||||
|
||||
/**
|
||||
* Returns a floating value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_float function.
|
||||
*
|
||||
* @param cvarname Cvar name to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to float
|
||||
*/
|
||||
native Float:get_cvar_float(const cvarname[]);
|
||||
|
||||
/**
|
||||
* Returns an integer value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_num function.
|
||||
*
|
||||
* @param cvarname Cvar name to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to int
|
||||
*/
|
||||
native get_cvar_num(const cvarname[]);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given integer value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_num function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_num(const cvarname[], value);
|
||||
|
||||
/**
|
||||
* Gets a string value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_string function.
|
||||
*
|
||||
* @param cvar Cvar name to retrieve value from
|
||||
* @param output Buffer to copy cvar value to
|
||||
* @param iLen Maximum size of the buffer
|
||||
*
|
||||
* @return Number of cells written to buffer.
|
||||
*/
|
||||
native get_cvar_string(const cvarname[], output[], iLen);
|
||||
|
||||
/**
|
||||
* Retrieves the name of the currently played map.
|
||||
*
|
||||
@ -1964,31 +1811,6 @@ native get_concmd_plid(cid, flag_mask, id_type);
|
||||
*/
|
||||
native get_concmdsnum(flag, id=-1);
|
||||
|
||||
/**
|
||||
* Returns the number of plugin-registered cvars.
|
||||
*
|
||||
* @return Number of registered cvars
|
||||
*/
|
||||
native get_plugins_cvarsnum();
|
||||
|
||||
/**
|
||||
* Retrieves information about a plugin-registered cvar.
|
||||
*
|
||||
* @note The returned cvar pointer should be used with the get_pcvar_* and
|
||||
* set_pcvar_* set of functions.
|
||||
*
|
||||
* @param num Cvar index, this does not equal the cvar pointer, it is
|
||||
* the internal index, incremented for each registered cvar
|
||||
* @param name Buffer to copy cvar name to
|
||||
* @param namelen Maximum buffer size
|
||||
* @param flags Variable to store cvar flags to
|
||||
* @param plugin_id Variable to store id of the registering plugin to
|
||||
* @param pcvar_handle Variable to store cvar pointer to
|
||||
*
|
||||
* @return 1 on success, 0 if index is invalid
|
||||
*/
|
||||
native get_plugins_cvar(num, name[], namelen, &flags=0, &plugin_id=0, &pcvar_handle=0);
|
||||
|
||||
/**
|
||||
* Returns unique menu id of a menu.
|
||||
*
|
||||
@ -2058,23 +1880,6 @@ native server_exec();
|
||||
*/
|
||||
native emit_sound(index, channel, const sample[], Float:vol, Float:att, flags, pitch);
|
||||
|
||||
/**
|
||||
* Registers a new cvar for the engine.
|
||||
*
|
||||
* @note For a list of possible cvar flags see FCVAR_* constants in amxconst.inc
|
||||
* @note If an already existing cvar is registered it will not be duplicated.
|
||||
* @note The returned cvar pointer should be used with the get_pcvar_* and
|
||||
* set_pcvar_* set of functions.
|
||||
*
|
||||
* @param name Cvar name
|
||||
* @param string Default cvar value
|
||||
* @param flags Cvar flags
|
||||
* @param fvalue Unused
|
||||
*
|
||||
* @return Unique cvar pointer
|
||||
*/
|
||||
native register_cvar(const name[], const string[], flags=0, Float:fvalue=0.0);
|
||||
|
||||
/**
|
||||
* Returns a random floating point value generated by the engine.
|
||||
*
|
||||
@ -2806,35 +2611,6 @@ native set_array(param, const source[], size);
|
||||
*/
|
||||
native set_array_f(param, const Float:source[], size);
|
||||
|
||||
/**
|
||||
* Dispatches a client cvar query, allowing the plugin to query for its value on
|
||||
* the client.
|
||||
*
|
||||
* @note The callback will be called in the following manner:
|
||||
*
|
||||
* public cvar_query_callback(id, const cvar[], const value[], const param[])
|
||||
*
|
||||
* id - Client index
|
||||
* cvar - Cvar queried
|
||||
* value - Cvar value on the client
|
||||
* param - Extra data [optional]
|
||||
*
|
||||
* @param id Client index
|
||||
* @param cvar Cvar to query
|
||||
* @param resultFunc Callback function
|
||||
* @param paramlen Size of extra data
|
||||
* @param params Extra data to pass through to callback
|
||||
*
|
||||
* @noreturn
|
||||
* @error If the client index is not within the range of 1 to
|
||||
* MaxClients or the client is not connected, an error
|
||||
* will be thrown.
|
||||
* If the callback function is invalid, cvar querying is
|
||||
* unavailable or the querying process runs out of memory,
|
||||
* an error will be thrown.
|
||||
*/
|
||||
native query_client_cvar(id, const cvar[], const resultFunc[], paramlen=0, const params[]="");
|
||||
|
||||
/**
|
||||
* Allows to trap error messages that occur in a plugin.
|
||||
*
|
||||
@ -3220,110 +2996,6 @@ native ExecuteForward(forward_handle, &ret, any:...);
|
||||
*/
|
||||
native DestroyForward(forward_handle);
|
||||
|
||||
/**
|
||||
* Returns the cvar pointer of the specified cvar.
|
||||
*
|
||||
* @note A pointer is also returned by register_cvar(). Plugins can (and should)
|
||||
* retrieve and use pointers for already existing mod cvars.
|
||||
*
|
||||
* @param cvar Cvar name to find
|
||||
*
|
||||
* @return Cvar pointer on success, 0 if cvar was not found
|
||||
*/
|
||||
native get_cvar_pointer(const cvar[]);
|
||||
|
||||
/**
|
||||
* Returns flags of a cvar via direct pointer access.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve flags from
|
||||
*
|
||||
* @return 1 on success, 0 if cvar pointer is invalid
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_flags(pcvar);
|
||||
|
||||
/**
|
||||
* Sets specified flags to a cvar via direct pointer access.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function directly sets the provided bitflag, unlike set_cvar_flags
|
||||
* which adds them using a bitwise OR.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set flags of
|
||||
* @param flags Bitflag sum of flags to set
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_flags(pcvar, flags);
|
||||
|
||||
/**
|
||||
* Returns an integer value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to int
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_num(pcvar);
|
||||
|
||||
/**
|
||||
* Sets an integer value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set value of
|
||||
* @param num Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_num(pcvar, num);
|
||||
|
||||
/**
|
||||
* Returns a float value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to float
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native Float:get_pcvar_float(pcvar);
|
||||
|
||||
/**
|
||||
* Sets a float value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set value of
|
||||
* @param num Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_float(pcvar, Float:num);
|
||||
|
||||
/**
|
||||
* Returns a string value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
* @param string Buffer to copy cvar value to
|
||||
* @param maxlen Maximum size of the buffer
|
||||
*
|
||||
* @return Number of cells written to buffer.
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_string(pcvar, string[], maxlen);
|
||||
|
||||
/**
|
||||
* Sets a string value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
* @param string Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_string(pcvar, const string[]);
|
||||
|
||||
/**
|
||||
* Sets all elements of array to a specified value.
|
||||
*
|
||||
|
@ -12,6 +12,58 @@
|
||||
#endif
|
||||
#define _cvars_included
|
||||
|
||||
/**
|
||||
* CVAR flags for register_cvar()
|
||||
*/
|
||||
#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_SERVER 4 /* Notifies players when changed */
|
||||
#define FCVAR_EXTDLL 8 /* Defined by external DLL */
|
||||
#define FCVAR_CLIENTDLL 16 /* Defined by the client dll */
|
||||
#define FCVAR_PROTECTED 32 /* It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value */
|
||||
#define FCVAR_SPONLY 64 /* This cvar cannot be changed by clients connected to a multiplayer server. */
|
||||
#define FCVAR_PRINTABLEONLY 128 /* This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). */
|
||||
#define FCVAR_UNLOGGED 256 /* If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log */
|
||||
#define FCVAR_NOEXTRAWHITEPACE 512 /* Strip trailing/leading white space from this cvar */
|
||||
|
||||
/**
|
||||
* Registers a new cvar for the engine.
|
||||
*
|
||||
* @note For a list of possible cvar flags see FCVAR_* constants in amxconst.inc
|
||||
* @note If an already existing cvar is registered it will not be duplicated.
|
||||
* @note The returned cvar pointer should be used with the get_pcvar_* and
|
||||
* set_pcvar_* set of functions.
|
||||
*
|
||||
* @param name Cvar name
|
||||
* @param string Default cvar value
|
||||
* @param flags Cvar flags
|
||||
* @param fvalue Unused
|
||||
*
|
||||
* @return Unique cvar pointer
|
||||
*/
|
||||
native register_cvar(const name[], const string[], flags=0, Float:fvalue=0.0);
|
||||
|
||||
/**
|
||||
* Returns if a cvar is registered on the server.
|
||||
*
|
||||
* @param cvar Cvar name to check
|
||||
*
|
||||
* @return 1 if the cvar exists, 0 otherwise
|
||||
*/
|
||||
native cvar_exists(const cvar[]);
|
||||
|
||||
/**
|
||||
* Returns the cvar pointer of the specified cvar.
|
||||
*
|
||||
* @note A pointer is also returned by register_cvar(). Plugins can (and should)
|
||||
* retrieve and use pointers for already existing mod cvars.
|
||||
*
|
||||
* @param cvar Cvar name to find
|
||||
*
|
||||
* @return Cvar pointer on success, 0 if cvar was not found
|
||||
*/
|
||||
native get_cvar_pointer(const cvar[]);
|
||||
|
||||
/**
|
||||
* Creates a hook for when a console variable's value is changed.
|
||||
*
|
||||
@ -49,4 +101,292 @@ native disable_cvar_hook(cvarhook:handle);
|
||||
*/
|
||||
native enable_cvar_hook(cvarhook:handle);
|
||||
|
||||
/**
|
||||
* Returns flags of a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_flags function.
|
||||
*
|
||||
* @param cvar Cvar name to retrieve flags from
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native get_cvar_flags(const cvar[]);
|
||||
|
||||
/**
|
||||
* Sets specified flags to a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Not permitted for the "amx_version", "amxmodx_version", "fun_version"
|
||||
* and "sv_cheats" cvars.
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function just adds the flags using a bitwise-or operation. After
|
||||
* it has run the flags may not exactly equal the specified bitflag sum.
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_flags function.
|
||||
*
|
||||
* @param cvar Cvar name to remove flags from
|
||||
* @param flags Bitflag sum of flags to set
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native set_cvar_flags(const cvar[], flags);
|
||||
|
||||
/**
|
||||
* Removes specified flags from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Not permitted for the "amx_version", "amxmodx_version", "fun_version"
|
||||
* and "sv_cheats" cvars.
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function removes the flags using a bitwise-and operation.
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_flags function.
|
||||
*
|
||||
*
|
||||
* @param cvar Cvar name to remove flags from
|
||||
* @param flags Bitflag sum of flags to remove
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
*/
|
||||
native remove_cvar_flags(const cvar[], flags=-1);
|
||||
|
||||
/**
|
||||
* Gets a string value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_string function.
|
||||
*
|
||||
* @param cvar Cvar name to retrieve value from
|
||||
* @param output Buffer to copy cvar value to
|
||||
* @param iLen Maximum size of the buffer
|
||||
*
|
||||
* @return Number of cells written to buffer.
|
||||
*/
|
||||
native get_cvar_string(const cvarname[], output[], iLen);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given string value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_string function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_string(const cvar[], const value[]);
|
||||
|
||||
/**
|
||||
* Returns a floating value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_float function.
|
||||
*
|
||||
* @param cvarname Cvar name to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to float
|
||||
*/
|
||||
native Float:get_cvar_float(const cvarname[]);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given float value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_float function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_float(const cvar[], Float:value);
|
||||
|
||||
/**
|
||||
* Returns an integer value from a cvar. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the get_pcvar_num function.
|
||||
*
|
||||
* @param cvarname Cvar name to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to int
|
||||
*/
|
||||
native get_cvar_num(const cvarname[]);
|
||||
|
||||
/**
|
||||
* Sets a cvar to a given integer value. The cvar is accessed by name.
|
||||
*
|
||||
* @note Accessing a Cvar by name requires this function to walk through the
|
||||
* engine's cvar list every time, which can result in a considerable waste
|
||||
* of processing time, especially if many cvars have been registered. For
|
||||
* a vastly superior alternative look at the set_pcvar_num function.
|
||||
*
|
||||
* @param cvar Cvar name to set value of
|
||||
* @param value Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
native set_cvar_num(const cvarname[], value);
|
||||
|
||||
/**
|
||||
* Returns flags of a cvar via direct pointer access.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve flags from
|
||||
*
|
||||
* @return 1 on success, 0 if cvar pointer is invalid
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_flags(pcvar);
|
||||
|
||||
/**
|
||||
* Sets specified flags to a cvar via direct pointer access.
|
||||
*
|
||||
* @note For a list of possible flags see the FCVAR_* constants in amxconst.inc
|
||||
* @note This function directly sets the provided bitflag, unlike set_cvar_flags
|
||||
* which adds them using a bitwise OR.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set flags of
|
||||
* @param flags Bitflag sum of flags to set
|
||||
*
|
||||
* @return 1 on success, 0 if cvar does not exist or is not permitted
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_flags(pcvar, flags);
|
||||
|
||||
/**
|
||||
* Returns an integer value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to int
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_num(pcvar);
|
||||
|
||||
/**
|
||||
* Sets an integer value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set value of
|
||||
* @param num Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_num(pcvar, num);
|
||||
|
||||
/**
|
||||
* Returns a float value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
*
|
||||
* @return Cvar value, converted to float
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native Float:get_pcvar_float(pcvar);
|
||||
|
||||
/**
|
||||
* Sets a float value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to set value of
|
||||
* @param num Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_float(pcvar, Float:num);
|
||||
|
||||
/**
|
||||
* Returns a string value from a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
* @param string Buffer to copy cvar value to
|
||||
* @param maxlen Maximum size of the buffer
|
||||
*
|
||||
* @return Number of cells written to buffer.
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native get_pcvar_string(pcvar, string[], maxlen);
|
||||
|
||||
/**
|
||||
* Sets a string value to a cvar via direct pointer access.
|
||||
*
|
||||
* @param pcvar Pointer to cvar to retrieve value from
|
||||
* @param string Value to set cvar to
|
||||
*
|
||||
* @noreturn
|
||||
* @error If an invalid cvar pointer is specified, an error is thrown.
|
||||
*/
|
||||
native set_pcvar_string(pcvar, const string[]);
|
||||
|
||||
/**
|
||||
* Returns the number of plugin-registered cvars.
|
||||
*
|
||||
* @return Number of registered cvars
|
||||
*/
|
||||
native get_plugins_cvarsnum();
|
||||
|
||||
/**
|
||||
* Retrieves information about a plugin-registered cvar.
|
||||
*
|
||||
* @note The returned cvar pointer should be used with the get_pcvar_* and
|
||||
* set_pcvar_* set of functions.
|
||||
*
|
||||
* @param num Cvar index, this does not equal the cvar pointer, it is
|
||||
* the internal index, incremented for each registered cvar
|
||||
* @param name Buffer to copy cvar name to
|
||||
* @param namelen Maximum buffer size
|
||||
* @param flags Variable to store cvar flags to
|
||||
* @param plugin_id Variable to store id of the registering plugin to
|
||||
* @param pcvar_handle Variable to store cvar pointer to
|
||||
*
|
||||
* @return 1 on success, 0 if index is invalid
|
||||
*/
|
||||
native get_plugins_cvar(num, name[], namelen, &flags=0, &plugin_id=0, &pcvar_handle=0);
|
||||
|
||||
/**
|
||||
* Dispatches a client cvar query, allowing the plugin to query for its value on
|
||||
* the client.
|
||||
*
|
||||
* @note The callback will be called in the following manner:
|
||||
*
|
||||
* public cvar_query_callback(id, const cvar[], const value[], const param[])
|
||||
*
|
||||
* id - Client index
|
||||
* cvar - Cvar queried
|
||||
* value - Cvar value on the client
|
||||
* param - Extra data [optional]
|
||||
*
|
||||
* @param id Client index
|
||||
* @param cvar Cvar to query
|
||||
* @param resultFunc Callback function
|
||||
* @param paramlen Size of extra data
|
||||
* @param params Extra data to pass through to callback
|
||||
*
|
||||
* @noreturn
|
||||
* @error If the client index is not within the range of 1 to
|
||||
* MaxClients or the client is not connected, an error
|
||||
* will be thrown.
|
||||
* If the callback function is invalid, cvar querying is
|
||||
* unavailable or the querying process runs out of memory,
|
||||
* an error will be thrown.
|
||||
*/
|
||||
native query_client_cvar(id, const cvar[], const resultFunc[], paramlen=0, const params[]="");
|
Reference in New Issue
Block a user