Actually, I just found this in weapons.cpp:
Code:
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
{
if ( UseDecrement() )
skiplocal = 1;
else
skiplocal = 0;
m_pPlayer->pev->weaponanim = iAnim;
#if defined( CLIENT_WEAPONS )
if ( skiplocal && ENGINE_CANSKIP( m_pPlayer->edict() ) )
return;
#endif
MESSAGE_BEGIN( MSG_ONE, SVC_WEAPONANIM, NULL, m_pPlayer->pev );
WRITE_BYTE( iAnim ); // sequence number
WRITE_BYTE( pev->body ); // weaponmodel bodygroup.
MESSAGE_END();
}
So it seems that the server(?) sends a message type to the client to tell it to change the sequence and body group. So is it possible to trap this kind of messages?
I wondered if register_event would do it actually. I've seen event "23" being hooked which is a SVC_TEMPENTITY. In this case SVC_WEAPONANIM is 30, so if I register and event for that I guess I could read out the values being sent? That sound about right?