From 173b86f4acae9d94d286b3597dafe923405b5c69 Mon Sep 17 00:00:00 2001 From: Greyscale Date: Mon, 25 Jan 2010 02:07:39 -0800 Subject: [PATCH] Switched the plugin to use SDKHooks instead of the unstable ZRTools. --- env/include/sdkhooks.inc | 6 ++++-- src/zombiereloaded.sp | 2 +- src/zr/weapons/restrict.inc | 5 +---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/env/include/sdkhooks.inc b/env/include/sdkhooks.inc index b712ec0..b225c8c 100644 --- a/env/include/sdkhooks.inc +++ b/env/include/sdkhooks.inc @@ -54,6 +54,7 @@ enum SDKHookType SDKHook_Touch, SDKHook_TraceAttack, SDKHook_TraceAttackPost, + SDKHook_WeaponCanSwitchTo, SDKHook_WeaponCanUse, SDKHook_WeaponDrop, SDKHook_WeaponEquip, @@ -74,6 +75,7 @@ funcenum SDKHookCB public(entity, other), // SetTransmit Action:public(entity, client), + // WeaponCanSwitchTo // WeaponCanUse // WeaponDrop // WeaponEquip @@ -84,7 +86,7 @@ funcenum SDKHookCB // OnTakeDamagePost public(victim, attacker, inflictor, Float:damage, damagetype), // FireBullets - public(client, shots, String:weaponname[]), + public(client, shots, const String:weaponname[]), // TraceAttack Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup), // TraceAttackPost @@ -162,4 +164,4 @@ public Extension:__ext_sdkhooks = #else required = 0, #endif -}; \ No newline at end of file +}; diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 450a027..9b8e5c0 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 2d477b5..71d2886 100644 --- a/src/zr/weapons/restrict.inc +++ b/src/zr/weapons/restrict.inc @@ -139,10 +139,7 @@ RestrictClientInit(client) { // Hook "Weapon_CanUse" on client. #if defined USE_SDKHOOKS - SDKHook(client, SDKHook_WeaponEquip, RestrictCanUse); - - // Note: Do we need to use WeaponSwitch too? On infection all weapons - // are removed anyways. + SDKHook(client, SDKHook_WeaponCanUse, RestrictCanUse); // Set dummy value so it think it's hooked. g_iCanUseHookID[client] = 1;