keybode

Cvar

Jan 25th, 2014
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. class ConVar;
  2.  
  3. typedef void ( *FnChangeCallback_t )( ConVar *var, const char *pOldValue, float flOldValue );
  4.  
  5. class ConVar
  6. {
  7. public:
  8.     void SetValue( const char* pValue )
  9.     {
  10.         typedef void ( __thiscall* SetValueFn )( PVOID, const char* );
  11.         GetMethod< SetValueFn >( this, 0 )( this, pValue );
  12.     }
  13.  
  14.     char __pad0[ 0xC5 ];
  15.     FnChangeCallback_t m_fnChangeCallback;
  16. };
  17.  
  18. class ICvar
  19. {
  20. public:
  21.     ConVar* FindVar( const char* var_name )
  22.     {
  23.         typedef ConVar* ( __thiscall* FindVarFn )( PVOID, const char* );
  24.         return GetMethod< FindVarFn >( this, 12 )( this, var_name );
  25.     }
  26. };
Advertisement
Add Comment
Please, Sign In to add comment