Raised This Month: $ Target: $400
 0% 

Solved Wrong Shotgun Reload Animation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 07-06-2017 , 16:30   Re: Wrong Shotgun Reload Animation
Reply With Quote #1

Shotgun reload is done by hooking WeaponReload and WeaponIdle. Also why in WeaponIdle all offsets have +5? +5 is for players, +4 for weapons. What you better to do is to hook and supercede the Reload method and insert there your Shotgun_Reload method. PostFrame for shotguns is not needed.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-07-2017 , 06:45   Re: Wrong Shotgun Reload Animation
Reply With Quote #2

Quote:
Originally Posted by NiHiLaNTh View Post
What you better to do is to hook and supercede the Reload method and insert there your Shotgun_Reload method. PostFrame for shotguns is not needed.
You mean like this? (I haven't test yet)

PHP Code:
public fw_Weapon_Reload(iEnt)
{
    static 
id id get_pdata_cbase(iEntm_pPlayerXTRA_OFS_WEAPON)    

    static 
iBpAmmo iBpAmmo get_pdata_int(id381XTRA_OFS_PLAYER)
    static 
iClip iClip get_pdata_int(iEntm_iClipXTRA_OFS_WEAPON)
    static 
iId iId get_pdata_int(iEntm_iIdXTRA_OFS_WEAPON)
    static 
iMaxClip iMaxClip CLIP

    Shotgun_Reload
(iEntiIdiMaxClipiClipiBpAmmoid)
    return 
HAM_SUPERCEDE
}

Shotgun_Reload(iEntiIdiMaxClipiClipiBpAmmoid)
{
    if(
iBpAmmo <= || iClip == iMaxClip)
        return

    if(
get_pdata_int(iEntm_flNextPrimaryAttackXTRA_OFS_WEAPON) > 0.0)
        return

    switch( 
get_pdata_int(iEntm_fInSpecialReloadXTRA_OFS_WEAPON) )
    {
        case 
0:
        {
            switch(
g_Spas12_Mode[id])
            {
                case 
SPAS12_ASet_WeaponAnim(idANIM_START_A)
                case 
SPAS12_BSet_WeaponAnim(idANIM_START_B)
            }
        
            
set_pdata_int(iEntm_fInSpecialReload1XTRA_OFS_WEAPON)
            
set_pdata_float(idm_flNextAttack0.45)
            
set_pdata_float(iEntm_flTimeWeaponIdle0.4XTRA_OFS_WEAPON)
            
set_pdata_float(iEntm_flNextPrimaryAttack0.4XTRA_OFS_WEAPON)
            
set_pdata_float(iEntm_flNextSecondaryAttack0.4XTRA_OFS_WEAPON)
            return
        }
        case 
1:
        {
            if( 
get_pdata_float(iEntm_flTimeWeaponIdleXTRA_OFS_WEAPON) > 0.0 )
            {
                return
            }
            
set_pdata_int(iEntm_fInSpecialReload2XTRA_OFS_WEAPON)
            
            
//emit_sound(id, CHAN_ITEM, random_num(0,1) ? "weapons/reload1.wav" : "weapons/reload3.wav", 1.0, ATTN_NORM, 0, 85 + random_num(0,0x1f))
            
switch(g_Janus_Mode[id])
            {
                case 
JANUS_NORMALSet_WeaponAnim(idANIM_INSERT)
                case 
JANUS_SIGNALSet_WeaponAnim(idANIM_INSERT_SIGNAL)
            }

            
//set_pdata_float(iEnt, m_flTimeWeaponIdle, iId == CSW_XM1014 ? 0.30 : 0.45, XTRA_OFS_WEAPON)
            
if(iClip != iMaxClip)
                
set_pdata_float(iEntm_flTimeWeaponIdleiId == CSW_XM1014 0.30 0.30XTRA_OFS_WEAPON)
        }
        default:
        {
            
set_pdata_int(iEntm_iClipiClip 1XTRA_OFS_WEAPON)
            
set_pdata_int(id381iBpAmmo-1XTRA_OFS_PLAYER)
            
set_pdata_int(iEntm_fInSpecialReload1XTRA_OFS_WEAPON)
        }
    }

__________________
My plugin:
Celena Luna 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 23:10.


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