Raised This Month: $ Target: $400
 0% 

Right attack AnimExtention


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 03-03-2014 , 22:33   Right attack AnimExtention
Reply With Quote #1

Hi .

As achieving attack2(Right) in dualpistols AnimExtention


PHP Code:
public fw_primary_attack(weapon_ent)
{
    if(
pev_valid(weapon_ent) != 2)
        return 
HAM_IGNORED
        
    
static id
    id 
get_pdata_cbase(weapon_entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS);
    
    
// is that correct?
    
set_pdata_int(idm_ActivityACT_RANGE_ATTACK2
    
set_pdata_int(idm_IdealActivityACT_RANGE_ATTACK2)
    
    return 
HAM_IGNORED
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    if(
pev_valid(weapon_ent) != 2)
        return

    static 
id
    id 
get_pdata_cbase(weapon_entOFFSET_WEAPONOWNEROFFSET_LINUX_WEAPONS);


    
entity_set_string(idEV_SZ_viewmodelmodel_v_test)
    
entity_set_string(idEV_SZ_weaponmodelmodel_p_test)

    
set_pdata_string(idm_szAnimExtention 4"dualpistols", -1XO_PLAYER 4)

Sorry for my English.
__________________

Last edited by Destro-; 03-03-2014 at 22:34.
Destro- is offline
Old 03-04-2014, 03:59
NiHiLaNTh
This message has been deleted by NiHiLaNTh.
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 03-04-2014 , 04:01   Re: Right attack AnimExtention
Reply With Quote #2

Either call SetAnimation with Orpheu or use KORD_12.7 stock
Just use it like that: SetAnimation(id, ACT_RANGE_ATTACK1)

Code:
const ACT_RANGE_ATTACK1         = 28;
const ACT_RELOAD            = 32;

SetAnimation( pPlayer, pActivity )
{
    if( pev_valid( pPlayer ) != PDATA_SAFE )
        return;
    
    #define ACT_SWIM         6
    #define ACT_LEAP         8
    #define ACT_HOVER         50
   
    // CBaseAnimating
    const m_flFrameRate         = 36;
    const m_flGroundSpeed         = 37;
    const m_flLastEventCheck     = 38;
    const m_fSequenceFinished     = 39;
    const m_fSequenceLoops         = 40;
   
    // CBaseMonster
    const m_Activity         = 73;
    const m_IdealActivity         = 74;
    
    new iAnimDesired, iActivity = get_pdata_int( pPlayer, m_Activity, 5 );

    if( iActivity == ACT_SWIM || iActivity == ACT_LEAP || iActivity == ACT_HOVER )   
    {
        return;
    }
   
    new szAnim[ 64 ], Float:flFrameRate, Float:tTime
    get_pdata_string( pPlayer, m_szAnimExtention, szAnim, charsmax( szAnim ), 0, 20 );
    
    tTime = get_gametime( );
    
    if( pActivity == ACT_RANGE_ATTACK1 )
    {
        format( szAnim, charsmax( szAnim ), ( entity_get_int( pPlayer, EV_INT_flags ) & FL_DUCKING ) ? "crouch_shoot_%s" : "ref_shoot_%s", szAnim );
    }
    else if( pActivity == ACT_RELOAD )
    {
        format( szAnim, charsmax( szAnim ), ( entity_get_int( pPlayer, EV_INT_flags ) & FL_DUCKING ) ? "crouch_reload_%s" : "ref_reload_%s", szAnim );
    }
    
    if( ( iAnimDesired = lookup_sequence( pPlayer, szAnim, flFrameRate ) ) == -1 )
    {
        iAnimDesired = 0;
    }
    
    entity_set_float( pPlayer, EV_FL_frame, 0.0 );
    entity_set_float( pPlayer, EV_FL_framerate, 1.0 );
    entity_set_int( pPlayer, EV_INT_sequence, iAnimDesired );
    entity_set_float( pPlayer, EV_FL_animtime, tTime );
   
    set_pdata_int( pPlayer, m_fSequenceLoops, 0, 4 );
    set_pdata_int( pPlayer, m_fSequenceFinished, 0, 4 );
    set_pdata_int( pPlayer, m_Activity, pActivity, 5 );
    set_pdata_int( pPlayer, m_IdealActivity, pActivity, 5 );   
   
    set_pdata_float( pPlayer, m_flGroundSpeed, 0.0, 4 );
    set_pdata_float( pPlayer, m_flFrameRate, flFrameRate, 4 );
    set_pdata_float( pPlayer, m_flLastEventCheck, tTime, 4 );
}
__________________


Last edited by NiHiLaNTh; 03-04-2014 at 04:01.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 03-04-2014 , 13:23   Re: Right attack AnimExtention
Reply With Quote #3

Work using orpheu .

thanks
__________________
Destro- is offline
Reply



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 22:51.


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