Advertisement
keybode

engine chams

Aug 29th, 2014
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1. void __fastcall Hooked_DrawModelExecute ( void* thisptr, int edx, const DrawModelState_t& state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld )
  2. {
  3.     Color color;
  4.  
  5.     static IMaterial* mat = CreateMaterial ( true );
  6.        
  7.     CEntity* player = (CEntity*) m_pEntList->GetClientEntity ( pInfo.entity_index );
  8.  
  9.     bool active = false;
  10.  
  11.     if ( player && !player->IsDead () && player->GetBaseEntity ()->IsPlayer () )
  12.     {
  13.         int team = player->GetTeamNum ();
  14.            
  15.         if ( team == 2 )
  16.         {
  17.             color = Color ( 255, 0, 0, 255 );
  18.         }
  19.         else if ( team == 3 )
  20.         {
  21.             color = Color ( 0, 127, 255, 255 );
  22.         }
  23.         else
  24.         {
  25.             color = Color ( 0, 0, 0, 255 );
  26.         }
  27.  
  28.         mat->SetMaterialVarFlag ( MATERIAL_VAR_IGNOREZ, true );
  29.  
  30.         ForceMaterial ( color, mat );
  31.  
  32.         m_pModelRenderHook->GetMethod<DrawModelExecuteFn> ( 19 )( thisptr, state, pInfo, pCustomBoneToWorld );
  33.  
  34.         if ( team == 2 )
  35.         {
  36.             color = Color ( 255, 255, 0, 255 );
  37.         }
  38.         else if ( team == 3 )
  39.         {
  40.             color = Color ( 0, 255, 0, 255 );
  41.         }
  42.  
  43.         mat->SetMaterialVarFlag ( MATERIAL_VAR_IGNOREZ, false );
  44.  
  45.         ForceMaterial ( color, mat );
  46.  
  47.         active = true;
  48.     }
  49.        
  50.     m_pModelRenderHook->GetMethod<DrawModelExecuteFn> ( 19 )( thisptr, state, pInfo, pCustomBoneToWorld );
  51.  
  52.     if ( active )
  53.         ForceMaterial ( Color ( 0, 0, 0, 0 ), 0, 0 );
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement