Raised This Month: $ Target: $400
 0% 

Rate Of Fire


Post New Thread Reply   
 
Thread Tools Display Modes
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 03:05   Re: Rate Of Fire
Reply With Quote #11

no i havnt. ive seen it before. it makes all weapons ful auto corect ? i jsut want to speed up the rate of fire on all weapons wether autos or not. ill check it out . thanks ven.

EDIT: had to give u karma to make you hit 200 lol

Last edited by The Specialist; 11-17-2006 at 03:13.
The Specialist is offline
Send a message via AIM to The Specialist
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 11-17-2006 , 10:54   Re: Rate Of Fire
Reply With Quote #12

I have found the real ROF offset.
THIS Offsets are for CS.

Offset for primary attack are for windows 46/linux +4 (untested),for secondary attack windows 47/linux +4 (untested).

BUT there are somthing really recommend, to set the rof it must be in "FM_PlayerPreThink" or in event CurWeapon,
and it must check,that the offset is higher than 0.0, is it under 0.0,player is reloading/weapon idle.

I post here an example plugin to change ROF,but some weapons look bad/funny with fast fire,like knife have no attack animation if ROF to fast.
Code:
#define ROF 0.001 public plugin_init() {   register_plugin(PLUGIN, VERSION, AUTHOR)   register_forward(FM_PlayerPreThink, "PlayerPreThink") } public PlayerPreThink( id ) {    new clip,ammo    new weaponID = get_user_weapon(id,clip,ammo)    if(weaponID)    {        new weapon[32]        get_weaponname(weaponID,weapon,31)        new ent = find_ent(-1,weapon)        if(ent)        {         new Float:nextattack = get_pdata_float(ent,46,4)         if (nextattack > 0.0)             set_pdata_float(ent,46,ROF,4)        }    }    return FMRES_HANDLED; }

Have fun with empty 100 bullets in 1 sec

I attach the plugin which i have used to find the rof.
Attached Files
File Type: sma Get Plugin or Get Source (roffinder.sma - 401 views - 2.6 KB)
__________________

Last edited by schnitzelmaker; 11-17-2006 at 15:59.
schnitzelmaker is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-17-2006 , 17:10   Re: Rate Of Fire
Reply With Quote #13

OMG ! nice work Shnitz ! thanks alot man. this will save me alot bullshit doing a hacky job on myplugin gj thanks ++karma
The Specialist is offline
Send a message via AIM to The Specialist
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 08-15-2007 , 01:03   Re: Rate Of Fire
Reply With Quote #14

How exactly could I use the code posted above to make the galil fire slighter faster than normal (like in CS:S)?

I tried changing 'ROF' to different values but that doensn't work.
Voltron is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 08-15-2007 , 11:33   Re: Rate Of Fire
Reply With Quote #15

Here an little example to change rof to shoot faster(untested,not optimized):
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <engine> #define PLUGIN "Fastershooting" #define VERSION "1.0" #define AUTHOR "Administrator" new g_nCurWeapon[33][2] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event( "CurWeapon", "Event_ShotFired",  "b" ) } public Event_ShotFired( id ) {     new weaponID = read_data( 2 )     new wAmmo = read_data( 3 )         if( g_nCurWeapon[id][0] != weaponID ) // User Changed Weapons..     {         g_nCurWeapon[id][0] = weaponID         g_nCurWeapon[id][1] = wAmmo         return PLUGIN_CONTINUE     }     if( g_nCurWeapon[id][1] < wAmmo ) // User Reloaded..     {         g_nCurWeapon[id][1] = wAmmo         return PLUGIN_CONTINUE     }     if( g_nCurWeapon[id][1] == wAmmo ) // User did something else, but didn't shoot..         return PLUGIN_CONTINUE         g_nCurWeapon[id][1] = wAmmo     g_nCurWeapon[id][0] = weaponID         if(weaponID == CSW_GALIL)     {         new weapon[32]         get_weaponname(weaponID,weapon,31)         new ent = find_ent_by_owner(-1,weapon,id)         if(ent)         {             new Float:nextattack = get_pdata_float(ent,46,4)             if (nextattack > 0.0)             {                 new Float:changednextattack = nextattack - 0.2 // Example to shoot 0.2 seconds faster                 if (changednextattack > 0.0)                     set_pdata_float(ent,46,changednextattack,4)             }         }             }       return PLUGIN_CONTINUE }
__________________
schnitzelmaker is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 08-15-2007 , 23:43   Re: Rate Of Fire
Reply With Quote #16

schnitzelmaker,

It works perfectly.
I've found using a value of either 0.01 or 0.02 gives me the results I want.

Thanks!
Voltron is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 08-22-2007 , 04:24   Re: Rate Of Fire
Reply With Quote #17

Schnitzel,

Actually, there is a slight problem.
Sometimes when shooting there is a slight pause(like when you let go of the fire button) and then the gun keeps firing.

If you test this out by using the M249 and holding down the fire button, you'll see what I mean.

I've attached the code i've been using on my server.

If you can fix the glitch that would be cool. (Perhaps it needs to be optimised?)

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine> 

#define PLUGIN "Fastershooting"
#define VERSION "1.0"
#define AUTHOR "Administrator"

#pragma semicolon 1

new g_nCurWeapon[33][2];

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
        register_event( "CurWeapon", "Event_ShotFired",  "b" );
}

public Event_ShotFired( id ) 
{ 
    new weaponID = read_data( 2 );
    new wAmmo = read_data( 3 ); 
    
        if( g_nCurWeapon[id][0] != weaponID ) // User Changed Weapons.. 
        { 
            g_nCurWeapon[id][0] = weaponID; 
            g_nCurWeapon[id][1] = wAmmo; 
            return PLUGIN_CONTINUE; 
        } 
        if( g_nCurWeapon[id][1] < wAmmo ) // User Reloaded.. 
        { 
            g_nCurWeapon[id][1] = wAmmo; 
            return PLUGIN_CONTINUE;
        } 
        if( g_nCurWeapon[id][1] == wAmmo ) // User did something else, but didn't shoot.. 
            return PLUGIN_CONTINUE; 
    
    g_nCurWeapon[id][1] = wAmmo; 
    g_nCurWeapon[id][0] = weaponID; 
    
    if(weaponID == CSW_GALIL || weaponID == CSW_M249 || weaponID == CSW_UMP45)
        {
            new weapon[32];
            get_weaponname(weaponID,weapon,31);
            new ent = find_ent_by_owner(-1,weapon,id);
            if(ent)
            {
                new Float:nextattack = get_pdata_float(ent,46,4);
                if (nextattack > 0.0)
                {
                    new Float:changednextattack = nextattack - 0.02; // Example to shoot 0.2 seconds faster 
                    if (changednextattack > 0.0)
                  set_pdata_float(ent,46,changednextattack,4);
                }
        }
}  
    if(weaponID == CSW_FAMAS || weaponID == CSW_M4A1 || weaponID == CSW_SG552 || weaponID == CSW_AUG)
        {
            new weapon[32];
            get_weaponname(weaponID,weapon,31);
            new ent = find_ent_by_owner(-1,weapon,id);
            if(ent)
            {
                new Float:nextattack = get_pdata_float(ent,46,4);
                if (nextattack > 0.0)
                {
                    new Float:changednextattack = nextattack - 0.01; // Example to shoot 0.2 seconds faster 
                    if (changednextattack > 0.0)
                  set_pdata_float(ent,46,changednextattack,4);
                }
        }
}  
    return PLUGIN_CONTINUE;
}
Voltron is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 08-25-2007 , 16:34   Re: Rate Of Fire
Reply With Quote #18

Sry for late reply, i have test it on listen server and don't see it.
But afaik its a Problem with animation and with dedicated servers,while the rof is based on the client fps.
Another Plugins can also make this Problem.
It can be optimized but i dont think it fix your Problem.
__________________
schnitzelmaker is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 08-25-2007 , 22:37   Re: Rate Of Fire
Reply With Quote #19

Thanks for replying.
Yeah it works fine on a listen server. But not on dedicated.

I need to get this to work because it's SO much better when the weapons fire faster!

Maybe there's another way to go about this....like creating new guns.
Voltron is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 08-29-2007 , 05:53   Re: Rate Of Fire
Reply With Quote #20

Does anyone know which file(s) the rof for each weapon is stored?
Voltron is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode