Cvars: Add get/set_pcvar_bool natives

This commit is contained in:
Arkshine
2015-01-25 20:15:35 +01:00
parent 8a241ed0fd
commit 356a981164
3 changed files with 30 additions and 12 deletions

View File

@ -306,6 +306,16 @@ native set_pcvar_flags(pcvar, flags);
*/
native get_pcvar_num(pcvar);
/**
* Returns an boolean value from a cvar via direct pointer access.
*
* @param pcvar Pointer to cvar to retrieve value from
*
* @return Cvar value, converted to bool
* @error If an invalid cvar pointer is specified, an error is thrown.
*/
native bool:get_pcvar_bool(pcvar);
/**
* Sets an integer value to a cvar via direct pointer access.
*
@ -317,6 +327,17 @@ native get_pcvar_num(pcvar);
*/
native set_pcvar_num(pcvar, num);
/**
* Sets a boolean 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_bool(pcvar, bool:num);
/**
* Returns a float value from a cvar via direct pointer access.
*
@ -482,4 +503,4 @@ native get_plugins_cvar(num, name[], namelen, &flags=0, &plugin_id=0, &pcvar_han
* 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[]="");
native query_client_cvar(id, const cvar[], const resultFunc[], paramlen=0, const params[]="");