AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Call Knife showoff / idle animation (https://forums.alliedmods.net/showthread.php?t=282537)

fcastro16 05-09-2016 12:17

Call Knife showoff / idle animation
 
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(iduc_handle)
{
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED
    
    
if((pev(id,pev_button) & IN_USE))
    {
        new 
iCvar get_pcvar_numg_pCvar2 );
        
        if( 
get_user_weapon(id)== CSW_KNIFE )
            
UTIL_PlayWeaponAnimation(idiCvar)
    }
    return 
FMRES_HANDLED
}


stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, {000}, Player);
    
write_byte(Sequence);
    
write_byte(pev(Playerpev_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
}; 



All times are GMT -4. The time now is 18:44.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.