EDIT: I figured it out, the showoff animation is included in the idle animation.
Hello, I'm trying to call the knife idle animation when pressing the USE button, similarly to what CS:GO does when you press the F button.
The problem is it doesn't work while other sequences work just fine. From my understanding the show off animation is sequence 0;
I used the cvar so I can change between sequences while in game for testing purposes.
PHP Code:
public fwd_CmdStart(id, uc_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED
if((pev(id,pev_button) & IN_USE))
{
new iCvar = get_pcvar_num( g_pCvar2 );
if( get_user_weapon(id)== CSW_KNIFE )
UTIL_PlayWeaponAnimation(id, iCvar)
}
return FMRES_HANDLED
}
stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, Player);
write_byte(Sequence);
write_byte(pev(Player, pev_body))
message_end();
}
sequences
PHP Code:
enum generic_e
{
GENERIC_IDLE1 = 0,
GENERIC_IDLE2,
GENERIC_IDLE3,
GENERIC_SHOOT,
GENERIC_SHOOT2,
GENERIC_RELOAD,
GENERIC_RELOAD2,
GENERIC_DRAW,
GENERIC_HOLSTER,
GENERIC_SPECIAL
};