Hi! I want to speed up the reload speed in Half-Life. In my case for shotgun and crossbow.
Here is the code, where i stucked:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
//offsets
const m_pPlayer = 28
//const m_iId = 30 //?
const m_flNextPrimaryAttack = 35
const m_flNextSecondaryAttack = 36
//const m_flTimeWeaponIdle = 37
const m_fInReload = 43
//const m_flNextAttack = ??
const Float:reload_speed = 0.2 // default: 4.5
public plugin_init()
{
register_plugin("Reload Speed", "0.0.1", "ujjl")
RegisterHam(Ham_Item_PostFrame, "weapon_crossbow", "Item_PostFrame_Post", 1)
//RegisterHam(Ham_Weapon_Reload, "weapon_shotgun", "fwd_Reload",1)
}
public Item_PostFrame_Post(Entity)
{
if( get_pdata_int(Entity, m_fInReload, 4) )
{
new player_id = get_pdata_cbase(Entity, m_pPlayer, 4) //who are reloading
client_print(player_id,print_chat,"You are reloading your crossbow.")
/*
set_pdata_float(player_id, m_flNextAttack, crossbow_reload_speed, 5)
set_pdata_float(iEnt, m_flTimeWeaponIdle, crossbow_reload_speed , 4)
*/
}
}
Feel free to edit.
Can you help me find the
m_flTimeWeaponIdle and
m_flNextAttack offsets? (Or making this code to work.)