diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b7b9a..829e7f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index a119053..5a7e6c2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -### [CS:GO] Deathmatch (v2.0.7, 2016-10-08) +### [CS:GO] Deathmatch (v2.0.7a, 2017-01-11) csgo deathmatch plugin =============== diff --git a/deathmatch.zip b/deathmatch.zip index f5bd7db..c22a8fb 100644 Binary files a/deathmatch.zip and b/deathmatch.zip differ diff --git a/scripting/deathmatch.sp b/scripting/deathmatch.sp index b6fbb06..d6bf16b 100644 --- a/scripting/deathmatch.sp +++ b/scripting/deathmatch.sp @@ -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)." @@ -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; @@ -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]; @@ -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; } @@ -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) @@ -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; } @@ -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; } diff --git a/update.txt b/update.txt index 75e09e6..31e428b 100644 --- a/update.txt +++ b/update.txt @@ -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"