1.1 --- a/plugins/include/console.inc Sun Feb 11 00:17:54 2007 +0000
1.2 +++ b/plugins/include/console.inc Sun Feb 11 11:09:38 2007 +0000
1.3 @@ -75,6 +75,36 @@
1.4 native Handle:FindConVar(const String:name[]);
1.5
1.6 /**
1.7 + * Called when a console variable's value is changed.
1.8 + *
1.9 + * @param convar Handle to the convar that was changed.
1.10 + * @param oldValue String containing the value of the convar before it was changed.
1.11 + * @param newValue String containing the new value of the convar.
1.12 + * @noreturn
1.13 + */
1.14 +functag OnConVarChanged public(Handle:convar, const String:oldValue[], const String:newValue[]);
1.15 +
1.16 +/**
1.17 + * Creates a hook for when a console variable's value is changed.
1.18 + *
1.19 + * @param convar Handle to the convar.
1.20 + * @param callback An OnConVarChanged function pointer.
1.21 + * @noreturn
1.22 + * @error Invalid or corrupt Handle.
1.23 + */
1.24 +native HookConVarChange(Handle:convar, OnConVarChanged:callback);
1.25 +
1.26 +/**
1.27 + * Removes a hook for when a console variable's value is changed.
1.28 + *
1.29 + * @param convar Handle to the convar.
1.30 + * @param callback An OnConVarChanged function pointer.
1.31 + * @return True on success, false otherwise.
1.32 + * @error Invalid or corrupt Handle.
1.33 + */
1.34 +native bool:UnhookConVarChange(Handle:convar, OnConVarChanged:callback);
1.35 +
1.36 +/**
1.37 * Returns the boolean value of a console variable.
1.38 *
1.39 * @param convar Handle to the convar.
1.40 @@ -136,11 +166,11 @@
1.41 *
1.42 * @param convar Handle to the convar.
1.43 * @param value Buffer to store the value of the convar.
1.44 - * @param maxlen Maximum length of string buffer.
1.45 + * @param maxlength Maximum length of string buffer.
1.46 * @noreturn
1.47 * @error Invalid or corrupt Handle.
1.48 */
1.49 -native GetConVarString(Handle:convar, String:value[], maxlen);
1.50 +native GetConVarString(Handle:convar, String:value[], maxlength);
1.51
1.52 /**
1.53 * Sets the string value of a console variable.
1.54 @@ -172,6 +202,17 @@
1.55 native SetConVarFlags(Handle:convar, flags);
1.56
1.57 /**
1.58 + * Retrieves the name of a console variable.
1.59 + *
1.60 + * @param convar Handle to the convar.
1.61 + * @param value Buffer to store the name of the convar.
1.62 + * @param maxlength Maximum length of string buffer.
1.63 + * @noreturn
1.64 + * @error Invalid or corrupt Handle.
1.65 + */
1.66 +native GetConVarName(Handle:convar, const String:name[], maxlength);
1.67 +
1.68 +/**
1.69 * Retrieves the minimum floating point value that a console variable can contain.
1.70 *
1.71 * @param convar Handle to the convar.