View Single Post
Author Message
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 04-06-2012 , 07:36   [EXTENSION] PluginCvars v0.0.0.1 (2012-04-06)
Reply With Quote #1

Me noob at c++... anyway, this extension allows you to
  • get the description of a convar.
  • get the convarlist of a plugin to iterate over it.

PHP Code:
/**
 * Retrieves the description of a console variable.
 *
 * @param convar            Handle to the convar.
 * @param description       Buffer to store the description of the convar.
 * @param maxlength         Maximum length of string buffer.
 * @noreturn
 * @error                   Invalid or corrupt Handle.
 */
native GetConVarDescription(Handle:convarString:description[], maxlength);


/**
 * Returns a handle to the list of convars for a plugin
 *
 * @param hPlugin           Handle to the plugin.
 * @return                  Handle to the convar list or invalid handle
 *                          if it does not exist.
 * @error                   Invalid plugin.
 */
native Handle:GetConVarList(Handle:hPlugin);


/**
 * Returns the size of a convar list
 *
 * @param hList             Handle to the convar list.
 * @return                  Size of the convar list or -1 on error.
 * @error                   Invalid convar list.
 */
native GetConVarListSize(Handle:hList);


/**
 * Returns an iterator that can used to search through a convar list
 *
 * @param hList             Handle to the convar list.
 * @return                  Handle to iterate with. Must be closed via
 *                          CloseHandle():
 * @error                   Invalid convar list.
 */
native Handle:GetConVarListIterator(Handle:hList);


/**
 * Returns whether there are more convars available in the iterator.
 *
 * @param hIterator         Handle to the convar iterator.
 * @return                  True on more convars, false otherwise.
 * @error                   Invalid convar iterator.
 */
native bool:MoreConvars(Handle:hIterator);


/**
 * Returns the current convar in the iterator and advances the iterator.
 *
 * @param hIterator         Handle to the convar iterator.
 * @return                  Current convar the iterator is at, before
 *                          the iterator is advanced.
 * @error                   Invalid convar iterator.
 */
native Handle:ReadConvar(Handle:hIterator); 

Changelog and source on github.

I could not get rid of the metamod requirement. If someone can help me there: please do.
Attached Files
File Type: zip PluginCvars_0.0.0.1_binaries.zip (324.1 KB, 253 views)
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline