Raised This Month: $51 Target: $400
 12% 

How can i change fire rate of a weapon? [Witout plugins]


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-22-2009 , 19:26   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #21

I updated my previous post that will make the knife fast. I do not have that inc or zombieplague to test it with that mod.
__________________
Bugsy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-22-2009 , 19:53   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #22

#define IsPlayer(%1) (1<=%1<=32) <== should be maxClients not 32.
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-22-2009 , 20:07   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #23

Quote:
Originally Posted by arkshine View Post
#define IsPlayer(%1) (1<=%1<=32) <== should be maxClients not 32.
@ark

Fixed. Just for future reference, is using maxclients instead of 32 better just to not waste iterations or is there an error possibility?
__________________

Last edited by Bugsy; 03-22-2009 at 20:12.
Bugsy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-22-2009 , 20:12   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #24

It will give a bug if an index above the max players is given because the other entity indexes start at maxplayers + 1.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 03-23-2009 , 16:26   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #25

Quote:
Originally Posted by dogandcat View Post
alejandro pete de mierda porque no pensas tus propios modos y te dejas de copiar de sg?
MAN SPEAK IN ENGLISH + DONT INSULT.
AlejandroSk is offline
Send a message via MSN to AlejandroSk
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 05-03-2009 , 04:05   Re: How can i change fire rate of a weapon? [Witout plugins]
Reply With Quote #26

Quote:
Originally Posted by Bugsy View Post
PHP Code:
/*    Copyright © 2009, ConnorMcLeod

    Knife Rate is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Knife Rate; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Knife Rate"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define    m_flNextPrimaryAttack    46
#define    m_flNextSecondaryAttack    47
#define    m_flTimeWeaponIdle        48

#define IsPlayer(%1)    (1<=%1<=g_MaxPlayers)

new g_MaxPlayers;
new 
g_pCvarPrimaryAttackRateg_pCvarSecondaryAttackRate

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_pCvarPrimaryAttackRate register_cvar("amx_knife_attack1_rate""0.15")
    
g_pCvarSecondaryAttackRate register_cvar("amx_knife_attack2_rate""0.30")
    
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_knife""Knife_PrimaryAttack"1)
    
RegisterHam(Ham_Weapon_SecondaryAttack"weapon_knife""Knife_SecondaryAttack"1)
    
g_MaxPlayers get_maxplayers();
}


public 
Knife_PrimaryAttackiEnt )
{
    static 
Float:flRate flRate get_pcvar_float(g_pCvarPrimaryAttackRate)
    static 
id id peviEnt pev_owner );
    
    if ( 
IsPlayer(id) && is_user_survivor(id) )
    {
        
set_pdata_float(iEntm_flNextPrimaryAttackflRate4)
        
set_pdata_float(iEntm_flNextSecondaryAttackflRate4)
        
set_pdata_float(iEntm_flTimeWeaponIdleflRate4)
    }
}

public 
Knife_SecondaryAttackiEnt )
{
    static 
Float:flRate flRate get_pcvar_float(g_pCvarSecondaryAttackRate)
    static 
id id peviEnt pev_owner )
    
    if ( 
IsPlayer(id) && is_user_survivor(id) )
    {
        
set_pdata_float(iEntm_flNextPrimaryAttackflRate4)
        
set_pdata_float(iEntm_flNextSecondaryAttackflRate4)
        
set_pdata_float(iEntm_flTimeWeaponIdleflRate4)
    }

Can anyone modify this so it works properly when speeding up the rate of fire for automatic guns? (like the m4a1)

And when I say 'works properly', I mean the bullets shouldn't appear like they're skipping when you set cl_cmdrate & cl_updaterate both to 20.
__________________
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 00:15.


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