26/03/2014, 11:55 AM
Bueno, estaba haciendo limpieza y encontré este .sma de Connor que había probado para hacer una mejora de Velocidad de Recarga. Lo usé y me funcionó, lo único que tendría que corregirse son las animaciones ya que se bugean y no paran cuando terminas de recargar.
Código PHP:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Reload Speed"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.2.0"
#define ammount_reload(%1) (1 - (%1 * 0.1))
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.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_Item_PostFrame, szWeapon, "Item_PostFrame_Post", 1)
}
}
}
}
public Item_PostFrame_Post(iEnt)
{
if( get_pdata_int(iEnt, m_fInReload, 4) )
{
new Float:fDelay = g_fDelay[get_pdata_int(iEnt, m_iId, 4)] * ammount_reload(variable_de_mejoras[id])
set_pdata_float(get_pdata_cbase(iEnt, m_pPlayer, 4), m_flNextAttack, fDelay, 5)
set_pdata_float(iEnt, m_flTimeWeaponIdle, fDelay + 0.5, 4)
}
}