R4Z0R49/DayZMod — pull request #44 by KillzoneKid (2012-11-05 00:40:36+00:00)
Title: Damage handling

Basically I'm using Dammaged and MPKilled for few very good reasons. HandleDamage would fire for every hit point no matter if it got hit or not, where as Dammaged will fire for every affected hitpoint only. Also if you try to assign public variable to a vehicle for example _vehicle setVariable ["handlingdamagenow", true, true]; to stop unnescessary calls to database, get in out of driver seat and the variable is gone. Strange. Doesnt happen with passenger seat. Dammaged doesnt have this problem.

Also I spawn call to the database and delay it for 5 seconds while hitvariables collect the hits then call db once with all the update, this doesnt affect ingame damage handling. More checks also performed to not to bother with DB calls if there is no change or change is insignificant.

MPKilled also seems to handle vehicle kill better especially if you are in driver seat. Both event handlers are global so processing functions are serverside.

I cannot guarantee it will work with official build right out from the box, I submitting it more for study and reference.