Switched the plugin to use SDKHooks instead of the unstable ZRTools.
This commit is contained in:
parent
b66e93451c
commit
173b86f4ac
6
env/include/sdkhooks.inc
vendored
6
env/include/sdkhooks.inc
vendored
@ -54,6 +54,7 @@ enum SDKHookType
|
|||||||
SDKHook_Touch,
|
SDKHook_Touch,
|
||||||
SDKHook_TraceAttack,
|
SDKHook_TraceAttack,
|
||||||
SDKHook_TraceAttackPost,
|
SDKHook_TraceAttackPost,
|
||||||
|
SDKHook_WeaponCanSwitchTo,
|
||||||
SDKHook_WeaponCanUse,
|
SDKHook_WeaponCanUse,
|
||||||
SDKHook_WeaponDrop,
|
SDKHook_WeaponDrop,
|
||||||
SDKHook_WeaponEquip,
|
SDKHook_WeaponEquip,
|
||||||
@ -74,6 +75,7 @@ funcenum SDKHookCB
|
|||||||
public(entity, other),
|
public(entity, other),
|
||||||
// SetTransmit
|
// SetTransmit
|
||||||
Action:public(entity, client),
|
Action:public(entity, client),
|
||||||
|
// WeaponCanSwitchTo
|
||||||
// WeaponCanUse
|
// WeaponCanUse
|
||||||
// WeaponDrop
|
// WeaponDrop
|
||||||
// WeaponEquip
|
// WeaponEquip
|
||||||
@ -84,7 +86,7 @@ funcenum SDKHookCB
|
|||||||
// OnTakeDamagePost
|
// OnTakeDamagePost
|
||||||
public(victim, attacker, inflictor, Float:damage, damagetype),
|
public(victim, attacker, inflictor, Float:damage, damagetype),
|
||||||
// FireBullets
|
// FireBullets
|
||||||
public(client, shots, String:weaponname[]),
|
public(client, shots, const String:weaponname[]),
|
||||||
// TraceAttack
|
// TraceAttack
|
||||||
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup),
|
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup),
|
||||||
// TraceAttackPost
|
// TraceAttackPost
|
||||||
@ -162,4 +164,4 @@ public Extension:__ext_sdkhooks =
|
|||||||
#else
|
#else
|
||||||
required = 0,
|
required = 0,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -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>
|
||||||
|
@ -139,10 +139,7 @@ RestrictClientInit(client)
|
|||||||
{
|
{
|
||||||
// Hook "Weapon_CanUse" on client.
|
// Hook "Weapon_CanUse" on client.
|
||||||
#if defined USE_SDKHOOKS
|
#if defined USE_SDKHOOKS
|
||||||
SDKHook(client, SDKHook_WeaponEquip, RestrictCanUse);
|
SDKHook(client, SDKHook_WeaponCanUse, RestrictCanUse);
|
||||||
|
|
||||||
// Note: Do we need to use WeaponSwitch too? On infection all weapons
|
|
||||||
// are removed anyways.
|
|
||||||
|
|
||||||
// Set dummy value so it think it's hooked.
|
// Set dummy value so it think it's hooked.
|
||||||
g_iCanUseHookID[client] = 1;
|
g_iCanUseHookID[client] = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user