diff --git a/amxmodx/CMisc.h b/amxmodx/CMisc.h index 851ccc36..276b4714 100755 --- a/amxmodx/CMisc.h +++ b/amxmodx/CMisc.h @@ -13,32 +13,6 @@ #include "CList.h" #include "sh_list.h" -// ***************************************************** -// class CCVar -// ***************************************************** - -class CCVar -{ - cvar_t cvar; - String name; - String plugin; - -public: - CCVar(const char* pname, const char* pplugin, int pflags, float pvalue) : name(pname), plugin(pplugin) - { - cvar.name = (char*)name.c_str(); - cvar.flags = pflags; - cvar.string = ""; - cvar.value = pvalue; - } - - inline cvar_t* getCvar() { return &cvar; } - inline const char* getPluginName() { return plugin.c_str(); } - inline const char* getName() { return name.c_str(); } - inline bool operator == (const char* string) { return (strcmp(name.c_str(), string) == 0); } - int plugin_id; -}; - // ***************************************************** // class CPlayer // ***************************************************** diff --git a/amxmodx/amxmodx.h b/amxmodx/amxmodx.h index 654e1f27..76efc850 100755 --- a/amxmodx/amxmodx.h +++ b/amxmodx/amxmodx.h @@ -47,6 +47,7 @@ #include "CLang.h" #include "fakemeta.h" #include "amxxlog.h" +#include "cvars.h" #define AMXXLOG_Log g_log.Log #define AMXXLOG_Error g_log.LogError diff --git a/amxmodx/cvars.h b/amxmodx/cvars.h index a495f643..f267eae6 100644 --- a/amxmodx/cvars.h +++ b/amxmodx/cvars.h @@ -10,8 +10,41 @@ #ifndef CVARS_H #define CVARS_H +#include "cvardef.h" +#include "CString.h" + class CDetour; +class CCVar +{ + cvar_t cvar; + String name; + String plugin; + +public: + CCVar(const char* pname, const char* pplugin, int pflags, float pvalue) : name(pname), plugin(pplugin) + { + cvar.name = (char*)name.c_str(); + cvar.flags = pflags; + cvar.string = ""; + cvar.value = pvalue; + } + + inline cvar_t* getCvar() { + return &cvar; + } + inline const char* getPluginName() { + return plugin.c_str(); + } + inline const char* getName() { + return name.c_str(); + } + inline bool operator == (const char* string) { + return (strcmp(name.c_str(), string) == 0); + } + int plugin_id; +}; + void CreateCvarHook(void); extern CDetour *Cvar_DirectSetDetour;