diff --git a/env/include/sdkhooks.inc b/env/include/sdkhooks.inc index 0bc6463..b712ec0 100644 --- a/env/include/sdkhooks.inc +++ b/env/include/sdkhooks.inc @@ -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 diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 8662769..6fa97c3 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -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 diff --git a/src/zr/weapons/restrict.inc b/src/zr/weapons/restrict.inc index 98a1f97..a6417bb 100644 --- a/src/zr/weapons/restrict.inc +++ b/src/zr/weapons/restrict.inc @@ -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]);