Raised This Month: $ Target: $400
 0% 

Problem with Gait Sequence


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-02-2014 , 09:50   Problem with Gait Sequence
Reply With Quote #1

Hi, I have problem with gait sequence when the player activity is 28 (ACT_ATTACK) but if the player activity is 3 (ACT_IDLE) the gait sequence works fine. I've tried to replace the player activity with idle activity but it blocks the sequence.

The detail video is: http://youtu.be/jIDXilZxRss

Code:

PHP Code:
HamRegister(Ham_Weapon_PrimaryAttack"weapon_knife""OnCBase_KnifeAttack");
OrpheuRegisterHook(OrpheuGetFunction("SetAnimation""CBasePlayer"), "Orpheu_SetAnimation"OrpheuHookPost); 
PHP Code:
public Ham_Weapon_PrimaryAttack(iEnt)
{
    
get_pdata_cbase(iEnt414);
    
gSeq[iIndex] = 124;
}

public 
OrpheuHookReturn:Orpheu_SetAnimation(iIndex)
{
    if (!
is_user_alive(iIndex)) return OrpheuIgnored;
    
    new 
iWpn get_user_weapon(iIndex);
    
    if (
gPlay[iIndex])
    {
        
Set_PlayerSequence(iIndexgSeq[iIndex]);
        return 
OrpheuSupercede;
    }
    return 
OrpheuIgnored;
}

Set_PlayerSequence(iIndexiSeq)
{
    new 
iGait Get_GaitSequence(iIndex);
    
    
set_pev(iIndexpev_sequenceiSeq);
    
set_pev(iIndexpev_gaitsequenceiGait);
    
set_pev(iIndexpev_frame1.0);
    
set_pev(iIndexpev_framerate1.0);
    
gPlay[iIndex] = 0;
}

Get_GaitSequence(iIndex)
{
    new 
Float:flVelocity[3];
    
pev(iIndexpev_velocityflVelocity);
    
    new 
iFlags pev(iIndexpev_flags);
    new 
Float:flSpeed vector_length(flVelocity);
    new 
iWaterLevel pev(iIndexpev_waterlevel);
    new 
iMoveType pev(iIndexpev_movetype);
    
    if(
iWaterLevel 1)
    {
        if (
flSpeed <= 0.1) return 9;
        else return 
8;
    }
    else if (
iMoveType == MOVETYPE_FLY)
    {
        if (
iFlags FL_DUCKING) return 2;
        else return 
1;
    }
    else if (
iFlags FL_DUCKING)
    {
        if (
flSpeed <= 0.1) return 2;
        else if (!(
iFlags FL_ONGROUND)) return 6;
        else return 
5;
    }
    else if (!(
iFlags FL_ONGROUND)) return 6;
    else if (
0.0 flSpeed 100.0) return 3;
    else if (
flSpeed 100.0) return 4;
    
    return 
1;

__________________
What are you looking for here?

Last edited by DavidJr; 06-02-2014 at 09:51.
DavidJr is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:39.


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