Skip to content

Commit

Permalink
Updated to v2.0.7a
Browse files Browse the repository at this point in the history
Fixed: dm_headshot_only not working properly.
Fixed: Knife, grenade, and taser damage not being allowed when
dm_no_knife_damage was enabled.
Fixed: dm_headshot_only_allow_knife not working when dm_no_knife_damage
was enabled.
  • Loading branch information
Maxximou5 committed Jan 12, 2017
1 parent 8d9ede7 commit 62bdad9
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 52 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.0.7a:
- Fixed: dm_headshot_only not working properly.
- Fixed: Knife, grenade, and taser damage not being allowed when dm_no_knife_damage was enabled.
- Fixed: dm_headshot_only_allow_knife not working when dm_no_knife_damage was enabled.

v2.0.7:
- Updated: Improved ammo replenish system
- dm_replenish_ammo - (Default) 1 - Replenish ammo on reload.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### [CS:GO] Deathmatch (v2.0.7, 2016-10-08)
### [CS:GO] Deathmatch (v2.0.7a, 2017-01-11)
<a href="https://www.maxximou5.com/"><img src="https://maxximou5.com/sourcemod/assests/img/deathmatch_csgo.png" alt="csgo deathmatch plugin" width="600" /></a>
===============

Expand Down
Binary file modified deathmatch.zip
Binary file not shown.
78 changes: 39 additions & 39 deletions scripting/deathmatch.sp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma newdecls required

#define PLUGIN_VERSION "2.0.7"
#define PLUGIN_VERSION "2.0.7a"
#define PLUGIN_NAME "[CS:GO] Deathmatch"
#define PLUGIN_AUTHOR "Maxximou5"
#define PLUGIN_DESCRIPTION "Enables deathmatch style gameplay (respawning, gun selection, spawn protection, etc)."
Expand Down Expand Up @@ -244,10 +244,6 @@ int distanceSearchSuccesses = 0;
int distanceSearchFailures = 0;
int spawnPointSearchFailures = 0;

/* HS Only Variables */
char g_sGrenade[32];
char g_sWeapon[32];

/* Static Offsets */
static int g_iWeapons_Clip1Offset;

Expand Down Expand Up @@ -1873,6 +1869,16 @@ public Action Event_InfernoStartburn(Event event, const char[] name, bool dontBr

public Action OnTraceAttack(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &ammotype, int hitbox, int hitgroup)
{
if (noKnifeDamage)
{
char knife[32];
GetClientWeapon(attacker, knife, sizeof(knife));
if (StrEqual(knife, "weapon_knife") || StrEqual(knife, "weapon_bayonet"))
{
return Plugin_Handled;
}
}

if (hsOnly)
{
char weapon[32];
Expand All @@ -1884,11 +1890,11 @@ public Action OnTraceAttack(int victim, int &attacker, int &inflictor, float &da
{
return Plugin_Continue;
}
else if (hsOnly_AllowKnife && (StrContains(g_sWeapon, "weapon_knife") || StrContains(g_sWeapon, "weapon_bayonet")))
else if (hsOnly_AllowKnife && (StrEqual(weapon, "weapon_knife") || StrEqual(weapon, "weapon_bayonet")))
{
return Plugin_Continue;
}
else if (hsOnly_AllowNade && StrEqual(grenade, "hegrenade_projectile"))
else if (hsOnly_AllowNade && (StrEqual(grenade, "hegrenade_projectile") || StrEqual(grenade, "decoy_projectile") || StrEqual(grenade, "molotov_projectile")))
{
return Plugin_Continue;
}
Expand All @@ -1902,20 +1908,29 @@ public Action OnTraceAttack(int victim, int &attacker, int &inflictor, float &da
}
}

if (noKnifeDamage)
{
char weapon[32];
GetClientWeapon(attacker, weapon, sizeof(weapon));
if (StrContains(g_sWeapon, "weapon_knife") || StrContains(g_sWeapon, "weapon_bayonet"))
return Plugin_Handled;
}
return Plugin_Continue;
}

public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if (noKnifeDamage)
{
if (IsValidClient(attacker))
{
char knife[32];
GetClientWeapon(attacker, knife, sizeof(knife));
if (StrEqual(knife, "weapon_knife") || StrEqual(knife, "weapon_bayonet"))
{
return Plugin_Handled;
}
}
}

if (hsOnly)
{
char grenade[32];
char weapon[32];

if (IsValidClient(victim))
{
if (damagetype & DMG_FALL || attacker == 0)
Expand All @@ -1932,30 +1947,26 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam

if (IsValidClient(attacker))
{
GetEdictClassname(inflictor, g_sGrenade, sizeof(g_sGrenade));
GetClientWeapon(attacker, g_sWeapon, sizeof(g_sWeapon));
GetEdictClassname(inflictor, grenade, sizeof(grenade));
GetClientWeapon(attacker, weapon, sizeof(weapon));

if (damagetype & DMG_HEADSHOT)
{

return Plugin_Continue;
}
else
{
if (hsOnly_AllowKnife)
if (hsOnly_AllowKnife && (StrEqual(weapon, "weapon_knife") || StrEqual(weapon, "weapon_bayonet")))
{
if (StrContains(g_sWeapon, "weapon_knife") || StrContains(g_sWeapon, "weapon_bayonet"))
{
return Plugin_Continue;
}
return Plugin_Continue;
}

if (hsOnly_AllowNade)
else if (hsOnly_AllowNade && (StrEqual(grenade, "hegrenade_projectile") || StrEqual(grenade, "decoy_projectile") || StrEqual(grenade, "molotov_projectile")))
{
return Plugin_Continue;
}
else if (hsOnly_AllowTaser && StrEqual(weapon, "weapon_taser"))
{
if (StrEqual(g_sGrenade, "hegrenade_projectile") || StrEqual(g_sGrenade, "decoy_projectile") || StrEqual(g_sGrenade, "molotov_projectile"))
{
return Plugin_Continue;
}
return Plugin_Continue;
}
return Plugin_Handled;
}
Expand All @@ -1971,17 +1982,6 @@ public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &dam
}
}

if (noKnifeDamage)
{
if (IsValidClient(attacker))
{
GetClientWeapon(attacker, g_sWeapon, sizeof(g_sWeapon));
if (StrContains(g_sWeapon, "weapon_knife") || StrContains(g_sWeapon, "weapon_bayonet"))
{
return Plugin_Handled;
}
}
}
return Plugin_Continue;
}

Expand Down
18 changes: 6 additions & 12 deletions update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
{
"Version"
{
"Latest" "2.0.7"
"Previous" "2.0.6"
"Latest" "2.0.7a"
"Previous" "2.0.7"
}

"Notes" "Changes in 2.0.7:"
"Notes" "Updated: Improved ammo replenish system"
"Notes" "Updated: SDKHook performance and usage (thanks to Bacardi)"
"Notes" "Added: Support for late load, safely load the plugin at anytime."
"Notes" "Added: Primary only gun mode"
"Notes" "Added: No knife damage"
"Notes" "Fixed: Wrong language phrase for secondary weapons when not selected."
"Notes" "Fixed: Native SetConVarInt reported: Invalid convar handle 0 (error 4)"
"Notes" "Fixed: Native PrintHintText reported: Language phrase ^ not found"
"Notes" "Fixed: P2000 sounding like a deagle. P2000 must now be equipped in player's loadout."
"Notes" "Changes in 2.0.7a:"
"Notes" "Fixed: dm_headshot_only not working properly."
"Notes" "Fixed: Knife, grenade, and taser damage not being allowed when dm_no_knife_damage was enabled."
"Notes" "Fixed: dm_headshot_only_allow_knife not working when dm_no_knife_damage was enabled."
}

"Files"
Expand Down

0 comments on commit 62bdad9

Please sign in to comment.