Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __fastcall Hooked_DrawModelExecute ( void* thisptr, int edx, const DrawModelState_t& state, const ModelRenderInfo_t& pInfo, matrix3x4_t* pCustomBoneToWorld )
- {
- Color color;
- static IMaterial* mat = CreateMaterial ( true );
- CEntity* player = (CEntity*) m_pEntList->GetClientEntity ( pInfo.entity_index );
- bool active = false;
- if ( player && !player->IsDead () && player->GetBaseEntity ()->IsPlayer () )
- {
- int team = player->GetTeamNum ();
- if ( team == 2 )
- {
- color = Color ( 255, 0, 0, 255 );
- }
- else if ( team == 3 )
- {
- color = Color ( 0, 127, 255, 255 );
- }
- else
- {
- color = Color ( 0, 0, 0, 255 );
- }
- mat->SetMaterialVarFlag ( MATERIAL_VAR_IGNOREZ, true );
- ForceMaterial ( color, mat );
- m_pModelRenderHook->GetMethod<DrawModelExecuteFn> ( 19 )( thisptr, state, pInfo, pCustomBoneToWorld );
- if ( team == 2 )
- {
- color = Color ( 255, 255, 0, 255 );
- }
- else if ( team == 3 )
- {
- color = Color ( 0, 255, 0, 255 );
- }
- mat->SetMaterialVarFlag ( MATERIAL_VAR_IGNOREZ, false );
- ForceMaterial ( color, mat );
- active = true;
- }
- m_pModelRenderHook->GetMethod<DrawModelExecuteFn> ( 19 )( thisptr, state, pInfo, pCustomBoneToWorld );
- if ( active )
- ForceMaterial ( Color ( 0, 0, 0, 0 ), 0, 0 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement