Updated to support new sdk hooks release (1.1, 30 nov).

This commit is contained in:
richard 2009-12-02 18:42:57 +01:00
parent 37c9929bd4
commit abd4afe4c7
3 changed files with 6 additions and 4 deletions

View File

@ -54,6 +54,7 @@ enum SDKHookType
SDKHook_Touch,
SDKHook_TraceAttack,
SDKHook_TraceAttackPost,
SDKHook_WeaponCanUse,
SDKHook_WeaponDrop,
SDKHook_WeaponEquip,
SDKHook_WeaponSwitch
@ -73,6 +74,7 @@ funcenum SDKHookCB
public(entity, other),
// SetTransmit
Action:public(entity, client),
// WeaponCanUse
// WeaponDrop
// WeaponEquip
// WeaponSwitch

View File

@ -26,7 +26,7 @@
*/
// Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used.
//define USE_SDKHOOKS
//#define USE_SDKHOOKS
#pragma semicolon 1
#include <sourcemod>

View File

@ -165,7 +165,7 @@ RestrictOnClientDisconnect(client)
if (g_iCanUseHookID[client] != -1)
{
#if defined USE_SDKHOOKS
SDKUnhook(client, SDKHook_WeaponEquip, RestrictCanUse);
SDKUnhook(client, SDKHook_WeaponCanUse, RestrictCanUse);
#else
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);
#endif
@ -183,8 +183,8 @@ RestrictOnClientSpawn(client)
{
// Re-hook "canuse" on client.
#if defined USE_SDKHOOKS
SDKUnhook(client, SDKHook_WeaponEquip, RestrictCanUse); // <--- What happens if it's not already hooked???
SDKHook(client, SDKHook_WeaponEquip, RestrictCanUse);
SDKUnhook(client, SDKHook_WeaponCanUse, RestrictCanUse); // <--- What happens if it's not already hooked???
SDKHook(client, SDKHook_WeaponCanUse, RestrictCanUse);
g_iCanUseHookID[client] = 1;
#else
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);