Skip to content

LoadPlayerOnHorse

Lays a player across a horse - the mode’s own order.

The player shows knocked out across the horse’s back, behind the saddle, on every screen, follows the horse and cannot act until the body comes off (UnloadHorse, StopCarry, or anything in OnHorseUnload); a carry that holds the player ends first ("loaded"). Works with the players’ own grab switched off. Refused (false and the reason) when the player is dead, rides, sits in a cart, flies, carries someone, lies across a horse already, is in a dice match or a fall, or their game cannot; or when the horse is down, carries a body already, is in front of a cart or more than 10 metres from the player. A ridden or moving horse may take a body this way.

LoadPlayerOnHorse(horseId, pid)
Parameter Type
horseId number the horse’s entity id
pid number the player to lay across it

boolean, string - true when the player lies across the horse; false and the reason when not

-- /arrest: the knocked-out prisoner goes across the guard's horse
local horse = GetNearestEntity(pid, ENTITY_HORSE, 6)
if horse and IsPlayerKnockedOut(target) then
local ok, why = LoadPlayerOnHorse(horse, target)
if not ok then SendClientMessage(pid, COLOR_RED, why) end
end

LoadEntityOnHorse · UnloadHorse · GetPlayerLoadHorse · OnHorseUnload · the Carrying group of the index