Raised This Month: $ Target: $400
 0% 

[HELP] Ham Reload Post


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-03-2016 , 14:20   [HELP] Ham Reload Post
Reply With Quote #1

So im trying to hook that moment when the weapon is done reloading in order to set a custom clip to a weapon

i have tried this, but for some reason it is called when reload is triggered, not when it ends, any ideea why?

Code:
    RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "Ham_Weapon_Reload_Post", 1)
__________________
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 02-04-2016 , 01:52   Re: [HELP] Ham Reload Post
Reply With Quote #2

Quote:
Originally Posted by Depresie View Post
So im trying to hook that moment when the weapon is done reloading in order to set a custom clip to a weapon

i have tried this, but for some reason it is called when reload is triggered, not when it ends, any ideea why?

Code:
    RegisterHam(Ham_Weapon_Reload, "weapon_deagle", "Ham_Weapon_Reload_Post", 1)
What do you try to create?

That's what i found: https://forums.alliedmods.net/showth...ht=hook+reload
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-04-2016 , 02:13   Re: [HELP] Ham Reload Post
Reply With Quote #3

Reload is called when a user presses +reload (R by default). Looks like you don't really understand what a "post" hook is.
If you register a hook as "pre", you are able to intercept (supercede) it, or change original function call's arguments and return value. It means that your hook is called before the original function.
"Post" means that your hook is called after the original function call. There are no special cases like "Pre-hook happens before reload happens, and post-hook happens when the reload ends".
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-04-2016 , 06:29   Re: [HELP] Ham Reload Post
Reply With Quote #4

Thanks craxor, xPaw's tutorial made it clear for me, ham reload post is called after releasing the R button, not after the reload is done..

Kippy, you didnt understand what i meant above...
__________________
Depresie is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-04-2016 , 07:22   Re: [HELP] Ham Reload Post
Reply With Quote #5

Quote:
Originally Posted by Depresie View Post
Thanks craxor, xPaw's tutorial made it clear for me, ham reload post is called after releasing the R button, not after the reload is done..

Kippy, you didnt understand what i meant above...
I answered your question "any idea why?", and wrote exactly what you just wrote to Craxor. I surely understood what you meant.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-04-2016 , 10:22   Re: [HELP] Ham Reload Post
Reply With Quote #6

ohh, i guess i didnt read your post properly... xD
sorry, i just woke up when i wrote that.. =P
__________________
Depresie 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 09:34.


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