AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham Sandwich > EnableHamFoward etc (https://forums.alliedmods.net/showthread.php?t=87897)

MarkyUK 03-17-2009 22:09

Ham Sandwich > EnableHamFoward etc
 
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

Exolent[jNr] 03-17-2009 22:12

Re: Ham Sandwich > EnableHamFoward etc
 
Well, all I did was hit the magic button, type in "EnableHamForward" and it told me what I needed to know.

Arkshine 03-17-2009 22:39

Re: Ham Sandwich > EnableHamFoward etc
 
Save the handle from RegisterHam() and use DisableHamForward()/EnableHamForward() with this handle.

anakin_cstrike 03-18-2009 04:48

Re: Ham Sandwich > EnableHamFoward etc
 
You can look at plugins wich does that but with fakemeta. The same thing is with Ham (like arkshine said)

MarkyUK 03-18-2009 13:08

Re: Ham Sandwich > EnableHamFoward etc
 
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.


All times are GMT -4. The time now is 08:53.

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