AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About Reload speed (https://forums.alliedmods.net/showthread.php?t=87266)

smoothjazz 03-09-2009 00:37

About Reload speed
 
Is there any function can increase reload speed?
ex. increase reload speed 30% or something else
Thx!

Bugsy 03-09-2009 01:22

Re: About Reload speed
 
Do you care if the reload animation is shown?

smoothjazz 03-09-2009 05:08

Re: About Reload speed
 
No.......

ConnorMcLeod 03-09-2009 07:32

Re: About Reload speed
 
You want this for all weapons ?

smoothjazz 03-09-2009 07:47

Re: About Reload speed
 
Yes~~

ConnorMcLeod 03-09-2009 07:49

Re: About Reload speed
 
Try this :

#define RELOAD_RATIO 0.7
This is 30% quicker, feel free to change it.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Reload Speed"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.2.0"

#define RELOAD_RATIO 0.7

const NOCLIP_WPN_BS    = ((1<<2)|(1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
const 
SHOTGUNS_BS    = ((1<<CSW_M3)|(1<<CSW_XM1014))

// weapons offsets
const m_pPlayer            41
const m_iId                43
const m_flNextPrimaryAttack    46
const m_flNextSecondaryAttack    47
const m_flTimeWeaponIdle        48
const m_fInReload            54

const m_flNextAttack 83

stock 
const Float:g_fDelay[CSW_P90+1] = {
    
0.002.700.002.000.000.55,   0.003.153.300.004.50
         
2.703.503.352.453.30,   2.702.202.502.634.70
         
0.553.052.123.500.00,   2.203.002.450.003.40
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    new 
szWeapon[17]
    for(new 
i=1i<=CSW_P90i++)
    {
        if( !(
NOCLIP_WPN_BS & (1<<i)) && get_weaponname(iszWeaponcharsmax(szWeapon)) )
        {
            if( !(
SHOTGUNS_BS & (1<<i)) )
            {
                
RegisterHam(Ham_Item_PostFrameszWeapon"Item_PostFrame_Post"1)
            }
        }
    }
}

public 
Item_PostFrame_Post(iEnt)
{    
    if( 
get_pdata_int(iEntm_fInReload4) )
    {
        new 
Float:fDelay g_fDelay[get_pdata_int(iEntm_iId4)] * RELOAD_RATIO
        set_pdata_float
(get_pdata_cbase(iEntm_pPlayer4), m_flNextAttackfDelay5)
        
set_pdata_float(iEntm_flTimeWeaponIdlefDelay 0.54)
    }



smoothjazz 03-09-2009 08:30

Re: About Reload speed
 
thx so much~~

smoothjazz 03-09-2009 08:36

Re: About Reload speed
 
reloadspeed.sma<49--50>:error 008 : must be a constant expression assumed zero
reloadspeed.sma<50>error 017: unfined symbol "m_flNextAttack"

ConnorMcLeod 03-09-2009 08:38

Re: About Reload speed
 
Updated.

smoothjazz 03-09-2009 09:09

Re: About Reload speed
 
Can also increases reload speed for M3 and XM1104 ?

And how to set only for someone like ADM、VIP etc. can be affected?

Thx Again


All times are GMT -4. The time now is 08:58.

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