Raised This Month: $32 Target: $400
 8% 

[HAMSANDWICH] Invalid HamHook handle.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 09:21   [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #1

I am getting this error from server logs:

Code:
L 03/12/2014 - 12:35:42: [HAMSANDWICH] Invalid HamHook handle.
L 03/12/2014 - 12:35:42: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/12/2014 - 12:35:42: [AMXX] Run time error 10: native error (native "DisableHamForward")
L 03/12/2014 - 12:35:42: [AMXX]    [0] now.sma::StopGame (line 2256)
L 03/12/2014 - 12:35:42: [AMXX]    [1] now.sma::LogEvent_RoundEnd (line 889)
PHP Code:
register_logevent"LogEvent_RoundEnd",     2"1=Round_End"     );
    
RegisterHamHam_Killed"player""Fwd_PlayerKilled"); 
PHP Code:
if(runningStatus)
            {
                
runningStatus 0
                
                unregister_forward
(FM_SetModelintSetModel)
                
unregister_forward(FM_CmdStartintCmdStart)
                
unregister_forward(FM_UpdateClientDataintCliendData)
                
unregister_forward(FM_TouchintTouch)
                
DisableHamForward(Forward_Killed);
                
DisableHamForward(Forward_TakeDamage);
                
unregister_forward(FM_TouchForward_Touch2);
                
unregister_forward(FM_PlayerPreThinkForward_PlayerPreThink);
                
unregister_forward(FM_AddToFullPackForward_Toggle0);
                
                for (new 
1<= g_pbcounta++)
                {
                    if (
g_pbstatus[a] != 0)
                    {
                        
paint_reset(g_paintballs[a]+1000);
                    }
                }
            } 
PHP Code:
public LogEvent_RoundEnd()
{    
    
StopGame();
    
    new 
players[32], num;
    
get_playersplayersnum"a" );
    
    for( new 
0numi++ )
    
show_menu00"^n");
    

What Am I doing wrong?
proffs is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2014 , 09:25   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #2

I don't see Forward_Killed/Forward_TakeDamage set.
__________________

Last edited by Arkshine; 03-12-2014 at 09:25.
Arkshine is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 10:17   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #3

PHP Code:
new     Forward_Touch2,
    
HamHook:Forward_Killed,
    
HamHook:Forward_TakeDamage,
    
Forward_PlayerPreThink,
    
Forward_Toggle 
PHP Code:
EnableHamForward(Forward_Killed)
EnableHamForward(Forward_TakeDamage

Last edited by proffs; 03-12-2014 at 10:17.
proffs is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2014 , 10:22   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #4

Forward_Killed/Forward_TakeDamage are not set. You create the variables, but default value is 0, empty so. You are supposed to filled these variables with RegisterHam return value, otherwise how you can expect the module to know?
__________________
Arkshine is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 11:32   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Forward_Killed/Forward_TakeDamage are not set. You create the variables, but default value is 0, empty so. You are supposed to filled these variables with RegisterHam return value, otherwise how you can expect the module to know?
So I need to return it?
I dont get a shit, sorry.
Can you move this to request section and help me with it?
Thanks
proffs is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-12-2014 , 11:41   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #6

Forward_Killed = RegisterHam( Ham_Killed, "player", "Fwd_PlayerKilled", 1 );

Forward_Killed will contain an handle which can be used with EnableHamForward().

What you were doing was creating empty variable, so basically doing EnableHamForward(0) ; do you think module will be able to know what forward you're talking about?
__________________

Last edited by Arkshine; 03-12-2014 at 11:43.
Arkshine is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-12-2014 , 12:01   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
Forward_Killed = RegisterHam( Ham_Killed, "player", "Fwd_PlayerKilled", 1 );

Forward_Killed will contain an handle which can be used with EnableHamForward().

What you were doing was creating empty variable, so basically doing EnableHamForward(0) ; do you think module will be able to know what forward you're talking about?
So I should remove the all of the variables
and have
PHP Code:
Forward_Killed RegisterHamHam_Killed"player""Fwd_PlayerKilled"); 
in plugin unit? So the module knows what Forward I am trying to enable?
proffs is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-12-2014 , 15:48   Re: [HAMSANDWICH] Invalid HamHook handle.
Reply With Quote #8

If there is a public function Fwd_PlayerKilled in code and if you want to use it as a callback of function CBasePlayer::Killed, you need to set it using RegisterHam(Ham_Killed, "player", "Fwd_PlayerKilled", 0 or 1)

Once this is done, consider EnableHamForward and DisableHamForward as additional features.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 15:56.


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