Raised This Month: $ Target: $400
 0% 

block in_attack2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 05-11-2009 , 09:33   block in_attack2
Reply With Quote #1

how would you block e.g the in_attack2 key on a client?

ive use prethink and:

PHP Code:
new button pev(id,pev_button)
 
if(
button IN_ATTACK2)
      
set_pev(id,pev_button,button & ~IN_ATTACK2
but i was wondering if theres a better way
__________________
Dr.G is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 05-11-2009 , 09:42   Re: block in_attack2
Reply With Quote #2

do u want to block it for all weapons?
__________________
minimiller is offline
Send a message via MSN to minimiller
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-11-2009 , 09:42   Re: block in_attack2
Reply With Quote #3

I would use FM_CmdStart instead of prethink.

But a better way would be to set to 9999.0 the offset m_flNextSecondaryAttack
(47) when you deploy a weapon. ( Ham_Item_Deploy )
Arkshine is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 05-11-2009 , 19:36   Re: block in_attack2
Reply With Quote #4

thank you
__________________
Dr.G is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-11-2009 , 20:02   Re: block in_attack2
Reply With Quote #5

Quote:
Originally Posted by arkshine View Post
But a better way would be to set to 9999.0 the offset m_flNextSecondaryAttack
(47) when you deploy a weapon. ( Ham_Item_Deploy )
I noticed it resets after the player shoots... you could need to set it again after each shot

edit: yep, works perfectly, I also needed this, thanks from me too
PHP Code:
RegisterHam(Ham_Item_Deploy"weapon_knife""fwHam_blockSecAttack"1)
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_knife""fwHam_blockSecAttack"1)

public 
fwHam_blockSecAttack(entset_pdata_float(ent479999.0
__________________

Last edited by Hunter-Digital; 05-11-2009 at 20:07.
Hunter-Digital is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 05-12-2009 , 01:53   Re: block in_attack2
Reply With Quote #6

How about Ham_Weapon_SecondaryAttack?
SnoW is offline
Send a message via MSN to SnoW
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-12-2009 , 07:59   Re: block in_attack2
Reply With Quote #7

It's less code, yeah, BUT... the animation still plays while you're holding down the button, in the other method, the attack it's just delayed for 9999 seconds, that means it will never happen :}
__________________
Hunter-Digital 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 01:34.


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