How do you keep all the time the same model of hands according to the team and and for the class selected by the player ?
Thank you in advance for your help
Sorry for my bad English, but I am a French frog

It is currently Fri May 31, 2024 6:16 am










$model "arms" "arms_team_red.smd"
$model "arms" "arms_team_blue.smd"
void CBaseViewModel::SetWeaponModel( const char *modelname, CBaseCombatWeapon *weapon )
{
m_hWeapon = weapon;
#if defined( CLIENT_DLL )
SetModel( modelname );
#else
string_t str;
if ( modelname != NULL )
{
str = MAKE_STRING( modelname );
}
else
{
str = NULL_STRING;
}
if ( str != m_sVMName )
{
// Msg( "SetWeaponModel %s at %f\n", modelname, gpGlobals->curtime );
m_sVMName = str;
SetModel( STRING( m_sVMName ) );
// Create any vgui control panels associated with the weapon
SpawnControlPanels();
bool showControlPanels = weapon && weapon->ShouldShowControlPanels();
SetControlPanelsActive( showControlPanels );
}
#endif
}
int iArmsGroup = FindBodygroupByName( "arms" );
if( iArmsGroup == -1 )
return;



if ( GetOwner() && GetOwner()->IsPlayer() )
{
CHL2MP_Player *pPlayer = assert_cast<CHL2MP_Player*>( GetOwner() );
if ( pPlayer->GetTeamNumber() = TEAM )
{
YOUR CODE
}















Users browsing this forum: No registered users