Raised This Month: $ Target: $400
 0% 

bug in hamsandwich ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-08-2010 , 12:01   bug in hamsandwich ?
Reply With Quote #1

When I hook Ham_Weapon_PrimaryAttack, it is called constantly when im firing pistols until i pull of the attack key. Every other weapon works fine, just the pistols.

If someone didn't understand - When I'm holding attack button when using a pistol, the hook is called every frame. It should be called only once, cause i activated weapon only once.

Could someone fix this ?

I did a workaround by sending client cmd "-attack;-attack" each time they fire a pistol. But its still firing that function every frame when someone is holding attack button when using a pistol.
__________________
Voi is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-08-2010 , 12:22   Re: bug in hamsandwich ?
Reply With Quote #2

Ham_Weapon_PrimaryAttack is called whenever you hold down your primary attack button (+attack).
__________________
hleV is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-08-2010 , 12:49   Re: bug in hamsandwich ?
Reply With Quote #3

This method works great or you can use CurWeapon

http://forums.alliedmods.net/showthread.php?t=54887
__________________
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-08-2010 , 14:08   Re: bug in hamsandwich ?
Reply With Quote #4

This is not a bug.

It is sent as soon as m_flPrimaryAttack is <= 0.0

Then, if you look a deagle code decompiled bu arkshine : http://cs-sdk.googlecode.com/svn/trunk/wpn_deagle.cpp

DEAGLEFire is sent.

Then if m_iShotsFired is > 1, not shot is fired.

Basically you have to filter Ham_Weapon_PromaryAttack with offset m_iShotsFired >=1 (>= because i haven't been incremented yet) (m_iShotsFired is 64 + extra linux 4), but this only for deagle and some other pistols, with glock, pay attention on firemode, for other weapons, look at CSSDK first.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 03:37.


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