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_Touch,
|
||||||
SDKHook_TraceAttack,
|
SDKHook_TraceAttack,
|
||||||
SDKHook_TraceAttackPost,
|
SDKHook_TraceAttackPost,
|
||||||
|
SDKHook_WeaponCanUse,
|
||||||
SDKHook_WeaponDrop,
|
SDKHook_WeaponDrop,
|
||||||
SDKHook_WeaponEquip,
|
SDKHook_WeaponEquip,
|
||||||
SDKHook_WeaponSwitch
|
SDKHook_WeaponSwitch
|
||||||
@ -73,6 +74,7 @@ funcenum SDKHookCB
|
|||||||
public(entity, other),
|
public(entity, other),
|
||||||
// SetTransmit
|
// SetTransmit
|
||||||
Action:public(entity, client),
|
Action:public(entity, client),
|
||||||
|
// WeaponCanUse
|
||||||
// WeaponDrop
|
// WeaponDrop
|
||||||
// WeaponEquip
|
// WeaponEquip
|
||||||
// WeaponSwitch
|
// WeaponSwitch
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used.
|
// Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used.
|
||||||
//define USE_SDKHOOKS
|
//#define USE_SDKHOOKS
|
||||||
|
|
||||||
#pragma semicolon 1
|
#pragma semicolon 1
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
|
@ -165,7 +165,7 @@ RestrictOnClientDisconnect(client)
|
|||||||
if (g_iCanUseHookID[client] != -1)
|
if (g_iCanUseHookID[client] != -1)
|
||||||
{
|
{
|
||||||
#if defined USE_SDKHOOKS
|
#if defined USE_SDKHOOKS
|
||||||
SDKUnhook(client, SDKHook_WeaponEquip, RestrictCanUse);
|
SDKUnhook(client, SDKHook_WeaponCanUse, RestrictCanUse);
|
||||||
#else
|
#else
|
||||||
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);
|
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);
|
||||||
#endif
|
#endif
|
||||||
@ -183,8 +183,8 @@ RestrictOnClientSpawn(client)
|
|||||||
{
|
{
|
||||||
// Re-hook "canuse" on client.
|
// Re-hook "canuse" on client.
|
||||||
#if defined USE_SDKHOOKS
|
#if defined USE_SDKHOOKS
|
||||||
SDKUnhook(client, SDKHook_WeaponEquip, RestrictCanUse); // <--- What happens if it's not already hooked???
|
SDKUnhook(client, SDKHook_WeaponCanUse, RestrictCanUse); // <--- What happens if it's not already hooked???
|
||||||
SDKHook(client, SDKHook_WeaponEquip, RestrictCanUse);
|
SDKHook(client, SDKHook_WeaponCanUse, RestrictCanUse);
|
||||||
g_iCanUseHookID[client] = 1;
|
g_iCanUseHookID[client] = 1;
|
||||||
#else
|
#else
|
||||||
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);
|
ZRTools_UnhookWeapon_CanUse(g_iCanUseHookID[client]);
|
||||||
|
Loading…
Reference in New Issue
Block a user