Raised This Month: $ Target: $400
 0% 

Changin knife speed


Post New Thread Reply   
 
Thread Tools Display Modes
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-08-2009 , 16:23   Re: Changin knife speed
Reply With Quote #11

Quote:
Originally Posted by Exolent[jNr] View Post
Can't this be achieved with the offset m_flNextAttack?
No.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-08-2009 , 17:25   Re: Changin knife speed
Reply With Quote #12

This seems to work.

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

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)
}

public 
Knife_PrimaryAttackiEnt )
{
    static 
Float:flRate flRate get_pcvar_float(g_pCvarPrimaryAttackRate)

    
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)

    
set_pdata_float(iEntm_flNextPrimaryAttackflRate4)
    
set_pdata_float(iEntm_flNextSecondaryAttackflRate4)
    
set_pdata_float(iEntm_flTimeWeaponIdleflRate4)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-09-2009 , 13:07   Re: Changin knife speed
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
This seems to work.

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

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)
}

public 
Knife_PrimaryAttackiEnt )
{
    static 
Float:flRate flRate get_pcvar_float(g_pCvarPrimaryAttackRate)

    
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)

    
set_pdata_float(iEntm_flNextPrimaryAttackflRate4)
    
set_pdata_float(iEntm_flNextSecondaryAttackflRate4)
    
set_pdata_float(iEntm_flTimeWeaponIdleflRate4)

will try
allthough +karma for just helping

edit: im not user to hamsandwich, well not at all, but how can i get the ham onwer, i mean the knive owner, as if i were using fakemeta and pev(entity, pev_owner)

Last edited by Speed!; 02-09-2009 at 13:20.
Speed! is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-09-2009 , 13:24   Re: Changin knife speed
Reply With Quote #14

Code:
#define m_pPlayer    41 [....] new id = get_pdata_cbase(iEnt, m_pPlayer, 4) // id is the knife's owner.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-09-2009 , 15:55   Re: Changin knife speed
Reply With Quote #15

Quote:
Originally Posted by Dores View Post
Code:
#define m_pPlayer    41 [....] new id = get_pdata_cbase(iEnt, m_pPlayer, 4) // id is the knife's owner.
thnks +k
Speed! is offline
jackassak47
New Member
Join Date: May 2011
Old 09-11-2011 , 11:50   Re: Changin knife speed
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
This seems to work.

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

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)
}

public 
Knife_PrimaryAttackiEnt )
{
    static 
Float:flRate flRate get_pcvar_float(g_pCvarPrimaryAttackRate)

    
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)

    
set_pdata_float(iEntm_flNextPrimaryAttackflRate4)
    
set_pdata_float(iEntm_flNextSecondaryAttackflRate4)
    
set_pdata_float(iEntm_flTimeWeaponIdleflRate4)

will u plz combine ur both plugins means knife speed + knife rate

Thanks in advance
jackassak47 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 02:52.


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