Problem is that client predicts animations. That's handled by the cl_lw cvar, and it was made for saving bandwidth. Server will know about cl_lw value of every client. And mod gets that value with
CanSkipPlayer function.
SendWeaponAnim function it's the one who """sends""" animations to client. But they are never sent. Source code from CS:
PHP Code:
void CBasePlayerWeapon::SendWeaponAnim(int animation, int skiplocal)
{
m_pPlayer->pev->weaponanim = animation;
if ( !skiplocal || !ENGINE_CANSKIP( m_pPlayer->edict() ) )
{
MESSAGE_BEGIN( MSG_ONE, SVC_WEAPONANIM, NULL, m_pPlayer->pev );
WRITE_BYTE( iAnim ); // sequence number
WRITE_BYTE( pev->body ); // weaponmodel bodygroup.
MESSAGE_END();
}
}
On CS, SendWeaponAnim is present on every specific event that animation should be sent (idle, reload, grenade/c4 specific, etc). But SVC_WEAPONANIM msg is never send because
skiplocal param is always
true and ENGINE_CANSKIP will return 1 if client has cl_lw cvar enabled. So, guessing, this would be never called.
If you want to force animation send to client, just hook FM_CanSkipPlayer, make it return false, and recode weapon fire animation because CS didn't implement that thing on PrimaryAttack functions. (hook PlaybackEvent as a method described on a tutorial, forget which one)
By following this logic, you'll just need to edit weapon entity's pev_body value to the correct handgroup you want to show to player.
Also, I haven't tested this because I don't know if client predicts first and gets a response then, because in that case animations will screw up and this will go hell