Raised This Month: $ Target: $400
 0% 

Ham Sandwich > EnableHamFoward etc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MarkyUK
New Member
Join Date: Mar 2009
Old 03-17-2009 , 22:09   Ham Sandwich > EnableHamFoward etc
Reply With Quote #1

Hey,
I'm new to AMX MOD X scripting so this is one of my first scripts so bare with me.

I am using Ham Sandwich to hook player spawn. This works fine.
What I can't do is disable the hook when I don't require it.

I understand that I need to use EnableHamForward() and DisableHamForward() but I don't understand how to use them.

Could someone provide me with some sample code using the functions EnableHamForward() and DisableHamForward()?

Or atleast tell me what goes in the brackets :p

Thanks,
Marky_UK
MarkyUK is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-17-2009 , 22:12   Re: Ham Sandwich > EnableHamFoward etc
Reply With Quote #2

Well, all I did was hit the magic button, type in "EnableHamForward" and it told me what I needed to know.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2009 , 22:39   Re: Ham Sandwich > EnableHamFoward etc
Reply With Quote #3

Save the handle from RegisterHam() and use DisableHamForward()/EnableHamForward() with this handle.
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 03-18-2009 , 04:48   Re: Ham Sandwich > EnableHamFoward etc
Reply With Quote #4

You can look at plugins wich does that but with fakemeta. The same thing is with Ham (like arkshine said)
__________________

anakin_cstrike is offline
MarkyUK
New Member
Join Date: Mar 2009
Old 03-18-2009 , 13:08   Re: Ham Sandwich > EnableHamFoward etc
Reply With Quote #5

enum HamHook {
BAD_HOOK_VALUE = 0
}

And then:
new HamHook:hamFwd = RegisterHam(Ham_xxx, "xxx", "xxx")
if(hamFwd == BAD_HOOK_VALUE) {
/* Handle HAM error here. */
}

Yeah, I had been looking at the answer for ages but I didnt understand this code at the time (2am :p)
Thank you very much for your help.
MarkyUK 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 08:53.


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