A simple plugin for managing the vast majority of the damage in the game.
I spent a lot of time counting the damage types of the game and trying to figure out a way to manage the damage simply. Since the damage types are always mixed (or the multiple weapon damage types are the same), I It is always difficult to find a perfect solution.
This plugin is the best solution I can write now. I have abandoned the management of upgraded weapons ammo(such as explosive and incendiary) for the most convenient management.
I also have an image that plots all the types of damage I have identified and I hope it can help you.
(My ENGLISH not good, so may not everyone could fully understand my explanation, sorry
)
Note: Only script can't be compiled, you also need l4d2_damage_type.inc, so if you need this plugin, please download easydamagmanager.zip
PHP Code:
Method of implementing functionality:
Handle:
h_grenade_launcher = CreateConVar("l4d_damage_grenade_launcher", "1.0", "damage coefficient of grenade launcher", FCVAR_FLAG);
h_grenade_launcher_ff = CreateConVar("l4d_damage_grenade_launcher_ff", "0.0", "damage coefficient of grenade launcher to survivor", FCVAR_FLAG);
h_infected_claw = CreateConVar("l4d_damage_infected_claw", "10.0", "damage coefficient of infected_claw", FCVAR_FLAG);
etc...
Use the API:
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype){
if(damagetype == sometype){
do something
}
}