AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Rate Of Fire (https://forums.alliedmods.net/showthread.php?t=47316)

The Specialist 11-15-2006 01:07

Rate Of Fire
 
I need to know how to adjust a users rate of fire on all weapons. So i can either make them fire faster or slower then normal . thanks guys :)

schnitzelmaker 11-15-2006 08:02

Re: Rate Of Fire
 
http://forums.alliedmods.net/showthread.php?t=41265

The Specialist 11-15-2006 15:56

Re: Rate Of Fire
 
yes. i know how to block fire since i have already done that. i need to make a persons gun fire faster then normal. that tutorial shows how to block using time until next attack . but time until next attack wont make a gun fire faster will it?

p3tsin 11-15-2006 16:41

Re: Rate Of Fire
 
its in there, just above the quick reference part :grrr:

Quote:

Originally Posted by KCE (Post 351561)
Custom Weapon ROF (Rate-of-fire)
  • I did this part on-the-fly...anyways there are, of course, many ways to do this. This is just one way; there may be others methods that could be better suited for your situation; just take a look at the above snippet from the Spawn Chat protection plugin.
  • Also the subtraction of the 0.001 is not neccessary but feel free to do it if needed. I believe it is done because it is checked with greater than (>) so the delay is slightly longer but only by a very miniscule amount.
  • Create some variables to store some info:
    Code:
    new g_NextAttack[33];   //stores players' next attack times new g_BlockAnim[33];    //stores players' variable for whether to block animation in UpdateClientData_Post new CVAR_rof;           //"pointer" to CVAR containing the rof; could also be define

...


The Specialist 11-15-2006 16:53

Re: Rate Of Fire
 
ive already read all of that. Im asking if time until next attack can be used to make a gun fire faster then normal . in that tutorial he shows how to block fireing for a certain amount of time using time until next attack.
Code:
set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001 );

can i use this to make the guns fire faster ? like this

Code:
set_cd(cd_handle, CD_flNextAttack, halflife_time() - 0.001 );

will this work ? thanks guys ++karma:up:

schnitzelmaker 11-16-2006 04:14

Re: Rate Of Fire
 
NO
Code:
set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001 );
0.001 is the rof,to have a rof of 1 second you must set set_cd(cd_handle, CD_flNextAttack, halflife_time() + 1.0 );

The Specialist 11-16-2006 04:28

Re: Rate Of Fire
 
so then i cant use that way to make it faster ? so then how would i go about making a gun faster ? lol :cry:

schnitzelmaker 11-16-2006 05:58

Re: Rate Of Fire
 
I have test a lot,sry it dont work, i can only set animation faster but not rof.

m_flNextAttack is only for reload and block rof.:cry:

But i think there is a way,after clientdata is the weapondata,that store the
m_flNextPrimaryAttack,which is the time to next fire.

But i didnt find a function in amxx for use it.

from hlsdk:
Code:

typedef struct local_state_s
{
        entity_state_t playerstate;
        clientdata_t  client;
        weapon_data_t  weapondata[ 32 ];
} local_state_t;


The Specialist 11-16-2006 17:03

Re: Rate Of Fire
 
LOL. hmmm , maybee ill jsut slow all attacks by .001 then speed up the one i want back to normal. it seems almost impossable to speed up the rate of fire past animations. thanks for all the help though ++karma :up:

VEN 11-17-2006 02:42

Re: Rate Of Fire
 
Have you looked into "Full Auto" plugin?


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

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