Pushok

BlahBlah

May 20th, 2012
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. #include "Hack.h"
  2.  
  3. Hack::CListener g_Listener;
  4.  
  5. SH_DECL_HOOK0( IVEngineClient, IsDrawingLoadingImage, SH_NOATTRIB, false, bool );
  6.  
  7. namespace Hack
  8. {
  9.     DWORD LoadPlugin( )
  10.     {
  11.         CFactory factory;
  12.  
  13.         try
  14.         {
  15.             Globals::g_pClientDLL =         factory.GetFactory< IBaseClientDLL >( "client.dll", "VClient016" );
  16.             Globals::g_pClientEngine =      factory.GetFactory< IVEngineClient >( "engine.dll", VENGINE_CLIENT_INTERFACE_VERSION );
  17.             Globals::g_pClientEntityList =  factory.GetFactory< IClientEntityList >( "client.dll", VCLIENTENTITYLIST_INTERFACE_VERSION );
  18.             Globals::g_pEventManager =      factory.GetFactory< IGameEventManager2 >( "engine.dll", INTERFACEVERSION_GAMEEVENTSMANAGER2 );
  19.             Globals::g_pDebugOverlay =      factory.GetFactory< IVDebugOverlay >( "engine.dll", VDEBUG_OVERLAY_INTERFACE_VERSION );
  20.             Globals::g_pCvar =              factory.GetFactory< ICvar >( "vstdlib.dll", CVAR_INTERFACE_VERSION );
  21.  
  22.             SH_ADD_HOOK( IVEngineClient, IsDrawingLoadingImage, Globals::g_pClientEngine, SH_STATIC( Hack::IsDrawingLoadingImage ), false );
  23.  
  24.             if( Globals::AllLoaded( ) )
  25.             {
  26.                 Globals::g_pEventManager->AddListener( &g_Listener, "player_death", false );
  27.  
  28.                 ConCommand* ComInfo = new ConCommand( "print_info_hk", CommandHandlers::InfoCommandHandler );
  29.  
  30.                 Globals::g_pCvar->RegisterConCommand( ComInfo );
  31.             }
  32.         }
  33.         catch( std::exception &ex )
  34.         {
  35.             MessageBox( nullptr, ex.what( ), "Error", MB_OK );
  36.  
  37.             return 1;
  38.         }
  39.  
  40.         return 0;
  41.     }
  42.  
  43.     void UnloadPlugin( )
  44.     {
  45.  
  46.     }
  47.  
  48.     bool IsDrawingLoadingImage( )
  49.     {
  50.         // Handler
  51.  
  52.         return false;
  53.     }
  54.  
  55.     void CListener::FireGameEvent( IGameEvent *event )
  56.     {
  57.  
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment