Tutaj ustawiamy mnożnik dla szybkości reloadu ( im mniejszy tym szybciej )
#define RELOAD_RATIO 0.5
#include <amxmodx> #include <fakemeta> #include <hamsandwich> #define PLUGIN "Reload Speed" #define AUTHOR "ConnorMcLeod" #define VERSION "0.2.0" #define RELOAD_RATIO 0.5 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_flTimeWeaponIdle = 48 const m_fInReload = 54 const m_flNextAttack = 83 stock const Float:g_fDelay[CSW_P90+1] = { 0.00, 2.70, 0.00, 2.00, 0.00, 0.55, 0.00, 3.15, 3.30, 0.00, 4.50, 2.70, 3.50, 3.35, 2.45, 3.30, 2.70, 2.20, 2.50, 2.63, 4.70, 0.55, 3.05, 2.12, 3.50, 0.00, 2.20, 3.00, 2.45, 0.00, 3.40 } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) new szWeapon[17] for(new i=1; i<=CSW_P90; i++) { if( !(NOCLIP_WPN_BS & (1<<i)) && get_weaponname(i, szWeapon, charsmax(szWeapon)) ) { if( !(SHOTGUNS_BS & (1<<i)) ) { RegisterHam(Ham_Weapon_Reload, szWeapon, "Weapon_Reload_Post", 1) } } } } public Weapon_Reload_Post(iEnt) { if( get_pdata_int(iEnt, m_fInReload, 4) ) { new id = get_pdata_cbase(iEnt, m_pPlayer, 4) new Float:fDelay = g_fDelay[get_pdata_int(iEnt, m_iId, 4)] * RELOAD_RATIO set_pdata_float(id, m_flNextAttack, fDelay, 5) set_pdata_float(iEnt, m_flTimeWeaponIdle, fDelay + 0.5, 4) } }