Skip to content

SetFallInjuries

Puts the injuries and the bleeding of a fall in the server’s record.

Off by default. A fall costs its health either way ([combat] fall_damage in server.toml), and the game itself injures the player’s legs in any fall over about 2 metres and makes a hard one bleed. Left off, those are the player’s own game’s alone: the server’s record says whole, GetPlayerInjuries and GetPlayerBleeding do not see them, and a reconnect wipes them.

With this on, the limbs the game injured are injured on the server too - GetPlayerInjuries lists them, OnPlayerInjury is called for each with attacker -1 - and a landing that bled opens a wound at the game’s own rate (about 0.12 health a second from 5 metres, 0.33 from 7) for the seconds of SetBleedRules, at most its maxRate; with its perDamage at 0 nothing bleeds. Everyone who sees the player sees the limp.

These injuries last until HealPlayer, SetPlayerInjuries or the respawn: the server’s record does not fade and the game’s own cures do not reach it. So a mode that turns this on gives its players a way to heal, or heals them itself. A fall from a siege ladder, a flying player’s landing and [combat] fall_damage = 0 injure nobody, this setting or not.

SetFallInjuries([enabled])
Parameter Type
enabled boolean false leaves them the player’s own game’s; left out = on (optional)

nothing

-- a roleplay server: a bad fall means a limp until the doctor has seen you
function OnGameModeInit()
SetFallInjuries(true)
end
function OnPlayerInjury(pid, attacker, part)
if attacker == -1 then SendClientMessage(pid, COLOR_RED, "You landed badly. See a doctor.") end
end

GetFallInjuries · OnPlayerInjury · SetPlayerInjuries · HealPlayer · SetBleedRules · the Vitals group of the index