View Single Post
hellmonja
Senior Member
Join Date: Oct 2015
Old 12-19-2019 , 08:11   Re: [HELP] Remove Rate of Fire Modifier on AUG/SG552
Reply With Quote #4

Hi everyone! So I found a solution so that AUG & SG552 will shoot at the same rate, zoomed in or not. Here's what I came up with:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define RPM_CONST        0.066500;

const m_flNextPrimaryAttack  46;
const 
m_pActiveItem         373;

public 
plugin_init()
{
    
register_plugin("RPM""1.0""hellmonja");

    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
}

public 
Event_CurWeapon(user)
{
    new 
wpn_id get_user_weapon(user);
    new 
weapon get_pdata_cbase(userm_pActiveItem);
    
    if(
wpn_id == CSW_SG552 || wpn_id == CSW_AUG)
    {
        if(
get_pdata_float(weaponm_flNextPrimaryAttack4) != RPM_CONST)
            
set_pdata_float(weaponm_flNextPrimaryAttackRPM_CONST4);
    }

0.066500 was taken when I checked what was the value of m_flNextPrimaryAttack when shooting both weapons without zooming in. I didn't use CD_flNextAttack for reasons that would be tl:dr to put here. Let's just say I need it set to a certain value all the time so that the other systems work properly...
__________________
hellmonja is offline