Permalink
Browse files

Add hook for player heal

Useful for event plugins, awarding points for healing etc.
  • Loading branch information...
1 parent 53879c8 commit 44be8f2c8a8c6a1a1d439f1e92ca4e7e68975295 @Kamshak Kamshak committed Jun 23, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 garrysmod/gamemodes/terrortown/entities/entities/ttt_health_station.lua
@@ -101,8 +101,9 @@ function ENT:GiveHealth(ply, max_heal)
-- constant clamping, no risks
local healed = self:TakeFromStorage(math.min(max_heal, dmg))
local new = math.min(ply:GetMaxHealth(), ply:Health() + healed)
-
+
ply:SetHealth(new)
+ hook.Run("TTTPlayerUsedHealthstation", ply, self, healed)
if last_sound_time + 2 < CurTime() then
self:EmitSound(healsound)

0 comments on commit 44be8f2

Please sign in to comment.