smrpg
smrpg copied to clipboard
Damage+ not working for weapon_hegrenade
As the title says, changing values for weapon_hegrenade in the damage_weapons.cfg doesn't have any effect.
My Current config is:
"DamagePlusWeapons"
{
"weapon_hegrenade"
{
"dmg_increase" "100000.1" //This is so high to test if it actually works.
"max_additional_dmg" "3500"
}
"weapon_m3"
{
"dmg_increase" "0.01"
"max_additional_dmg" "3500"
}
}
Changing the value for all weapons in smrpg_upgrade_damage.cfg does affect the HE grenade aswell however.
There is one unpleasant development option for grenades. After all, damage is added when a player takes damage. But at this moment, the enemy who attacked him is not the fact that he is holding a grenade. Because of this, this modification does not work for you.
` int iWeapon = inflictor; // Why do we need this?
if(inflictor > 0 && inflictor <= MaxClients)
iWeapon = Client_GetActiveWeapon(inflictor); // We get the enemy's active weapon (what he has in his hands at the time of the damage).
`
All this because:
SDKHook(client, SDKHook_OnTakeDamage, Hook_OnTakeDamage);
Most likely, in this case, it is necessary to change the logic of the entire skill, because it will not behave correctly in relation to grenades.
I believe we can check if the m_hThrower
or m_hOwner
prop is available on the attacker and use that instead of the active weapon. Would need some testing to get it right. I'm not sure which parameter would be the grenade projectile in OnTakeDamage.
It seems to me that m_hThrower
will be a more correct check, because after the cs go update in which were added grenades dropping, the damage is caused by the one who threw it.
I could also circumvent this for now by giving every weapon the value I want, and then change the overall damage in smrpg_upgrade_damage.cfg to a higher value. That way only the HE Grenade would deal a higher amount of damage since the damage_weapons.cfg seems to be working for all the other weapons.