Quote:
Originally Posted by
KawMAN
When i want to unhook something does SDKHooks check if this is hooked and I don't need to check that ?
What I tested quickly one hook type (SDKHook_WeaponDropPost)
Doesn't matter when you unhook what is not hooked.
No errors, replies or returns.
Quote:
Originally Posted by
KawMAN
Does SDKHooks prevent a "double" hooking (same hook, same callback twice) ?.
No
Use
SDKHookEx , it will return when Hook Successful or not
Quote:
Originally Posted by
KawMAN
I think that SDKHooks makes checking, but i want to make sure.
Regards
Why think instead try test it yourself ?
Spoiler
PHP Code:
#include <sdkhooks>
new counter ;
public OnPluginStart ()
{
RegAdminCmd ( "sm_hook" , hook , 0 , "Text here" );
RegAdminCmd ( "sm_unhook" , unhook , 0 , "Text here" );
}
public Action : hook ( client , args )
{
SDKHook ( client , SDKHook_WeaponDropPost , WeaponDropPost );
counter ++;
ReplyToCommand ( client , "hook %i" , counter );
return Plugin_Handled ;
}
public Action : unhook ( client , args )
{
SDKUnhook ( client , SDKHook_WeaponDropPost , WeaponDropPost );
counter --;
ReplyToCommand ( client , "unhook %i" , counter );
return Plugin_Handled ;
}
public WeaponDropPost ( client , weapon )
{
PrintToServer ( "WeaponDropPost %N weapon %i" , client , weapon );
}
__________________