View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-22-2019 , 09:57   Re: [HELP] Remove Rate of Fire Modifier on AUG/SG552
Reply With Quote #7

Here it is how it works(looking at AUG):
1.CAUG::SecondaryAttack is called when right click is pressed and it changes the FOV to simulate zooming.
2.Inside CAUG:: PrimaryAttack FOV is checked and AUGFire is called with different values depending on zoom status(zoomed in/out): 0.135 when zoomed it and 0.0825 when normal. This value is passed in flCycleTime parameter.
3.Inside AUGFire: m_flNextPrimaryAttack and m_flNextSecondaryAttack are set to GetNextAttackDelay(flCycleTime) which translates(for our purpose) to flCycleTime + 0.0 = flCycleTime.
Therefore flCycleTime controls the rate of fire.

Here is what you are doing:
Ham_Weapon_PrimaryAttack pre: set m_flNextPrimaryAttack
PrimaryAttack is executed -> AUGFire is executed -> game changes m_flNextPrimaryAttack overriding your change

Long story short: hook as POST not PRE. Also your value is wrong, it should be 0.0825 for default rate of fire.
__________________

Last edited by HamletEagle; 12-22-2019 at 09:58.
HamletEagle is offline