Updated to support new sdk hooks release (1.1, 30 nov).
This commit is contained in:
parent
37c9929bd4
commit
abd4afe4c7
2
env/include/sdkhooks.inc
vendored
2
env/include/sdkhooks.inc
vendored
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user