====== OnKilling hook callback function ======
OnKilling is called whenever a pawn's (a player's or a mob's) health reaches zero. This means that the pawn is about to be killed, unless a plugin "revives" them by setting their health back to a positive value.

FIXME There is no OnKilled() notification hook yet; this is deliberate because OnKilled() has been recently renamed to OnKilling(), and plugins need to be updated. Once updated, the OnKilled() notification will be implemented.

===== Function signature =====
<code lua>
function OnKilling(Victim, Killer)
</code>
Parameters:
| Victim | [[API:cPawn|cPawn]] | The player or mob that is about to be killed |
| Killer | [[API:cEntity|cEntity]] | The entity that has caused the victim to lose the last point of health. May be nil for environment damage |

===== Return values =====
If the function returns false or no value, MCServer calls other plugins with this event. If the function returns true, no other plugin is called for this event.

In either case, the victim's health is then re-checked and if it is greater than zero, the victim is "revived" with that health amount. If the health is less or equal to zero, the pawn is killed.

===== Register Callback =====
To register your plugin for a callback on this function use the hook [[api:plugin:hooks|HOOK_KILLING]]
<code lua>
PluginManager = cPluginManager:GetPluginManager();
PluginManager:AddHook(Plugin, cPluginManager.HOOK_KILLING);
</code>