Skip to content

OnPlayerPulledDown

A pull-down is over - the rider was thrown off the horse, or the pull failed.

success is true when the game’s take-down threw the rider off the horse - it comes before the OnPlayerDismount of the same fall - and false when the pull failed and the rider is still in the saddle (told when the pair’s animation ends, about four and a half seconds after the start). It does not run when the pull-down was cut short before its outcome showed: a death, a disconnect, a SetPlayerPos, a spawn, a cart seat, a flight. Nor does it run for a pull that was to land when the rider’s game never took them out of the saddle (a game that failed to play it): a mode that sets something at OnPlayerPullDown - a busy flag, a pending price - should let it expire by time rather than wait for this callback. The two players are in a fight from the start of the pull-down (OnFightStart). For a few seconds around the pair (IsPlayerInPullDown) the server lets both bodies move as the game’s pair moves them - an aligned step, a tumble - where a walker’s speed would be refused; that holds within about eight metres of where they stood when it began, and the ground and the walls are checked as ever. The fall is the game’s own ragdoll and get-up; whatever it costs the rider - health, a wound - is for the mode to decide here.

function OnPlayerPulledDown(pid, victim, id, success)
-- ...
end
Parameter Type
pid number the player who pulled
victim number the rider
id number the horse
success boolean true when the rider was thrown off, false when the pull failed

nothing

-- a fall from a horse costs 15 health
function OnPlayerPulledDown(pid, victim, id, success)
if not success then return end
SetPlayerHealth(victim, math.max(1, GetPlayerHealth(victim) - 15))
SendClientMessage(victim, COLOR_RED, GetPlayerName(pid) .. " pulled you off your horse!")
end

OnPlayerPullDown · OnPlayerDismount · PullPlayerFromHorse · IsPlayerInPullDown · the Horses group of the index