Skip to content

OnPlayerUnloadHorse

A player takes the body off a horse into their own carry - return false to refuse.

Only while the players’ own grab is on with the rule horses (SetCarrying). The server has checked that the player is on foot and free to carry, and that the horse stands still within reach; the mode has the last word. Returning false refuses - the body stays on the horse - anything else takes it off (OnHorseUnload with "taken down") and the player carries it (OnPlayerCarryStart). Not run for UnloadHorse. kind, id and victim are as in OnPlayerCarry.

function OnPlayerUnloadHorse(pid, horse, kind, id, victim)
-- ...
end
Parameter Type
pid number the player who takes it down
horse number the horse’s entity id
kind string "player", "corpse" or "actor"
id number the player’s id, or the entity id
victim number the player a corpse was; -1 otherwise

false refuses; nothing, nil or true lets the player take it

-- a prisoner across a horse is the guards' (team 1) to take down
function OnPlayerUnloadHorse(pid, horse, kind, id)
if kind == "player" and GetPlayerTeam(pid) ~= 1 then return false end
end

OnPlayerLoadHorse · OnHorseUnload · UnloadHorse · the Carrying group of the index