Rapid Fire mod for Grenade Launcher

  • hi guys, pls help me, is there anyone here who can teach me how to make the grenade launcher become full-auto, i tried lots, included searching inside the script file, but i couldn't find out how to enable that kind of function, i appreciate a lot if you guys can help me <3
    0% 0%
  • As far as I know, rapid fire function has something to do with certain netprops, like "m_flNextPrimaryAttack" & "m_flNextSecondaryAttack". If you can set those two netprops correctly, the weapon's rate of fire can change.
    
    If the rapid fire that you meant was the ability to keep shooting when holding fire button, that can be done by using "m_afButtonDisabled" netprops & then triggering that function in miliseconds. For example, like this:
    BuffTrigger <- 0
    function AutomaticShot()
    {
    	local survteam = null;
    	while(survteam = Entities.FindByClassname(survteam, "player"))
    	{
    		if(survteam.IsSurvivor())
    		{
    			if(Time() >= BuffTrigger)
    			{
    				local ReleasedButtons = NetProps.GetPropInt(survteam, "m_afButtonDisabled");
    				local IsDisabled = ReleasedButtons & 1;
    				local IsAttacking = survteam.GetButtonMask() & 1;
    				
    				local mainactiveweaponA = null;
    				if(survteam.GetActiveWeapon())
    				{
    					mainactiveweaponA = survteam.GetActiveWeapon().GetClassname();
    				}
    				
    				if(mainactiveweaponA == "weapon_grenade_launcher")
    				{
    					if(IsDisabled)
    					{
    						NetProps.SetPropInt(survteam, "m_afButtonDisabled", ReleasedButtons & ~1);
    					}
    					if(IsAttacking)
    					{
    						NetProps.SetPropInt(survteam, "m_afButtonDisabled", ReleasedButtons | 1);
    					}
    					
    				}
    			}
    		}
    	}
    	DoEntFire("!self", "CallScriptFunction", "AutomaticShot", 0.01, self, self);
    }
    function OnGameEvent_round_start_post_nav(event)
    {
    	AutomaticShot();
    }
    
    If you put those functions into a vscript file, you can make grenade launcher shoot continuously by holding fire button, but it's still affected by the weapon's rate of fire.
    0% 0%
  • Gg
    0% 0%

End of results.