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.
Syntax
Section titled “Syntax”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 |
Returns
Section titled “Returns”false refuses; nothing, nil or true lets the player take it
Example
Section titled “Example”-- a prisoner across a horse is the guards' (team 1) to take downfunction OnPlayerUnloadHorse(pid, horse, kind, id) if kind == "player" and GetPlayerTeam(pid) ~= 1 then return false endendSee also
Section titled “See also”OnPlayerLoadHorse · OnHorseUnload · UnloadHorse · the Carrying group of the index
