Raised This Month: $ Target: $400
 0% 

Ham_Weapon_PrimaryAttack Hook Problem/Glitch?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
uxMal
Member
Join Date: Oct 2007
Old 10-11-2009 , 08:30   Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #1

Hey,

i recently stumbled upon a strange issue with
Code:
RegisterHam(Ham_Weapon_PrimaryAttack,"weapon_deagle","func")
So it's getting executed everytime you shoot with the deagle but if you keep the mouse button pressed (as deagle does not shoot automatically) it gets executed every frame. I don't think its supposed to do so but whatever.

I made a workaround for it checking the bullet count and returning if the count hasn't changed but now are several new problems...

If you keep the button pressed a long time it executes the hook twice(even with the bullet check) because when you shoot you get the old bullet count before the shoot in the hooked function even if you set post hook to true but as it gets executed every frame after some time it gets the new bullet count after the first shot and shoots again....

Also im using this for superhero and because theres automatic reload so clip != 0 but sometimes it displays this in my func and this is glitching it too..

Any ideas on this?
uxMal is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-11-2009 , 08:53   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #2

It supposed to work like that.

Depending your need, you should hook the deagle shoot event. There is a tuto for that. It will be called only when you fire really.
__________________
Arkshine is offline
uxMal
Member
Join Date: Oct 2007
Old 10-11-2009 , 09:03   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #3

I searched for it but i just found CurWeapon with Clip check which is not accurate (i was using this mehthod before)

So could you provide a link or just tell me your way please?
uxMal is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-11-2009 , 09:38   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=54887
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-11-2009 , 09:50   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #5

What do you exactly want to do ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
uxMal
Member
Join Date: Oct 2007
Old 10-11-2009 , 10:02   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #6

I want to catch the shot event with the deagle..

The first 3 shots get a tracer and some effects, basically you can take the Hero Noob http://forums.alliedmods.net/showthr...ight=hero+Noob as an example
on every spawn you should have these first 3 shots but for example the method noob is using is glitching all the way


With Ham_Weapon_PrimaryAttack i got everything working except double shot when holding mouse button pressed


So the event i want is just when the deagle shoots a bullet
uxMal is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-11-2009 , 10:03   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #7

Use FM_PlaybackEvent from the link. It's fine for that.
__________________
Arkshine is offline
uxMal
Member
Join Date: Oct 2007
Old 10-11-2009 , 14:06   Re: Ham_Weapon_PrimaryAttack Hook Problem/Glitch?
Reply With Quote #8

Thanks Problem solved!
uxMal 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 22:43.


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