Add option to not bypass hooks with TakeDamage and DropWeapon natives.

This commit is contained in:
Nick Hastings
2021-10-13 12:56:26 -04:00
committed by Nicholas Hastings
parent 4a6d263dad
commit 97383028e5
4 changed files with 105 additions and 10 deletions
+5 -2
View File
@@ -416,11 +416,13 @@ native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
* @param weapon Weapon index (orangebox and later) or -1 for unspecified
* @param damageForce Velocity of damage force
* @param damagePosition Origin of damage
* @param bypassHooks If true, bypass SDK hooks on OnTakeDamage
* @error Invalid entity, attacker, inflictor, or weapon entity.
*/
native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
float damage, int damageType=DMG_GENERIC, int weapon=-1,
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR,
bool bypassHooks = true);
/**
* Forces a client to drop the specified weapon
@@ -429,10 +431,11 @@ native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
* @param weapon Weapon entity index.
* @param vecTarget Location to toss weapon to, or NULL_VECTOR for default.
* @param vecVelocity Velocity at which to toss weapon, or NULL_VECTOR for default.
* @param bypassHooks If true, bypass SDK hooks on Weapon Drop
* @error Invalid client or weapon entity, weapon not owned by client.
*/
native void SDKHooks_DropWeapon(int client, int weapon, const float vecTarget[3]=NULL_VECTOR,
const float vecVelocity[3]=NULL_VECTOR);
const float vecVelocity[3]=NULL_VECTOR, bool bypassHooks = true);
/**
* Do not edit below this line!