|
|
|
@@ -115,6 +115,7 @@ public void OnClientPutInServer(int client)
|
|
|
|
|
{
|
|
|
|
|
g_iSpecialKnife[client] = 0;
|
|
|
|
|
g_bNoSlowdown[client] = false;
|
|
|
|
|
g_bRestoreHP[client] = false;
|
|
|
|
|
g_bFullKnife[client] = false;
|
|
|
|
|
|
|
|
|
|
if(g_Config)
|
|
|
|
@@ -150,13 +151,17 @@ public void OnWeaponEquipped(int client, int entity)
|
|
|
|
|
if(!g_Config.JumpToKey(sHammerID))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
float fKnockbackMaxVel = g_Config.GetFloat("KnockbackMaxVel", 0.0);
|
|
|
|
|
if(fKnockbackMaxVel >= 0.0)
|
|
|
|
|
ZR_SetClientKnockbackMaxVelocity(client, fKnockbackMaxVel);
|
|
|
|
|
|
|
|
|
|
float fKnockbackScale = g_Config.GetFloat("KnockbackScale", 1.0);
|
|
|
|
|
ZR_SetClientKnockbackScale(client, fKnockbackScale);
|
|
|
|
|
|
|
|
|
|
float fKnockbackMaxForce = g_Config.GetFloat("KnockbackMaxForce", 0.0);
|
|
|
|
|
if(fKnockbackMaxForce >= 0.0)
|
|
|
|
|
ZR_SetClientKnockbackMaxForce(client, fKnockbackMaxForce);
|
|
|
|
|
|
|
|
|
|
float fKnockbackMaxVel = g_Config.GetFloat("KnockbackMaxVel", -1.0);
|
|
|
|
|
if(fKnockbackMaxVel >= 0.0)
|
|
|
|
|
ZR_SetClientKnockbackMaxVelocity(client, fKnockbackMaxVel);
|
|
|
|
|
|
|
|
|
|
g_bNoSlowdown[client] = view_as<bool>(g_Config.GetNum("NoSlowDown", 0));
|
|
|
|
|
|
|
|
|
|
g_bRestoreHP[client] = view_as<bool>(g_Config.GetNum("RestoreHP", 1));
|
|
|
|
@@ -172,8 +177,9 @@ public void OnWeaponDropped(int client, int entity)
|
|
|
|
|
{
|
|
|
|
|
if(entity == g_iSpecialKnife[client])
|
|
|
|
|
{
|
|
|
|
|
ZR_SetClientKnockbackMaxVelocity(client, 0.0);
|
|
|
|
|
ZR_SetClientKnockbackScale(client, 1.0);
|
|
|
|
|
ZR_SetClientKnockbackMaxForce(client, 0.0);
|
|
|
|
|
ZR_SetClientKnockbackMaxVelocity(client, -1.0);
|
|
|
|
|
g_iSpecialKnife[client] = 0;
|
|
|
|
|
g_bNoSlowdown[client] = false;
|
|
|
|
|
g_bRestoreHP[client] = false;
|
|
|
|
@@ -281,7 +287,7 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
|
|
|
|
|
g_LastAttacker = attacker;
|
|
|
|
|
g_LastVictim = victim;
|
|
|
|
|
|
|
|
|
|
int flags = ZR_KNOCKBACK_CUSTOM | ZR_KNOCKBACK_SCALE | ZR_KNOCKBACK_LIMITVEL;
|
|
|
|
|
int flags = ZR_KNOCKBACK_CUSTOM | ZR_KNOCKBACK_SCALE | ZR_KNOCKBACK_LIMITFORCE | ZR_KNOCKBACK_LIMITVEL;
|
|
|
|
|
|
|
|
|
|
if(g_bFullKnife[victim])
|
|
|
|
|
{
|
|
|
|
@@ -296,7 +302,7 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
|
|
|
|
|
GetEdictClassname(inflictor, sWeaponClassname, sizeof(sWeaponClassname));
|
|
|
|
|
|
|
|
|
|
if(StrEqual(sWeaponClassname, "weapon_knife"))
|
|
|
|
|
flags &= ~(ZR_KNOCKBACK_SCALE | ZR_KNOCKBACK_LIMITVEL);
|
|
|
|
|
flags &= ~(ZR_KNOCKBACK_SCALE | ZR_KNOCKBACK_LIMITFORCE | ZR_KNOCKBACK_LIMITVEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float flVelocityModifier;
|
|
|
|
@@ -307,7 +313,9 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
|
|
|
|
|
if(g_bRestoreHP[client])
|
|
|
|
|
iClientHealth = GetClientHealth(client);
|
|
|
|
|
|
|
|
|
|
damagetype |= DMG_DROWN;
|
|
|
|
|
// Don't damage kevlar.
|
|
|
|
|
damagetype |= DMG_RADIATION;
|
|
|
|
|
|
|
|
|
|
SDKHooks_TakeDamage(victim, inflictor, attacker, damage, damagetype, weapon, damageForce, damagePosition, flags);
|
|
|
|
|
|
|
|
|
|
if(g_bNoSlowdown[client])
|
|
|
|
|