Quote:
Originally Posted by HamletEagle
So why don't you hook PrimaryAttack and set the value there? Why do you need CurWeapon exactly?
|
Ah! You are right. I knew there's something wrong with this code. I actually took it off from another plugin that manipulates rate of fire. Thank you for the tip!...
EDIT:
Works intermittently, often not at all. When it works and you don't let go of the trigger it works fine. If you zoom-in and do short bursts then it sometimes switches back and forth from fast to slow, often slow. Perhaps that's the reason the guy put it in CurWeapon...
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define RPM_CONST 0.066500
const m_flNextPrimaryAttack = 46;
public plugin_init()
{
register_plugin("RPM", "1.0", "hellmonja")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_sg552", "Ham_Weapon_PrimaryAttack_Pre", false);
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_aug", "Ham_Weapon_PrimaryAttack_Pre", false);
}
public Ham_Weapon_PrimaryAttack_Pre(weapon)
{
// if(get_pdata_float(weapon, m_flNextPrimaryAttack, 4) != RPM_CONST)
set_pdata_float(weapon, m_flNextPrimaryAttack, RPM_CONST, 4);
}
Perhaps in FM_PlaybackEvent then check for evetid? Will try it tomorrow. I need to sleep...
__________________