OnPlayerStealHorse
A player got on a horse another player owns - return false to put them off it.
The game’s own “Mount and steal”: the thief is already in the saddle on their screen. Return false and they are put off
it (the horse goes back to its owner if the owner is in the world, else it stands still) and the horse is not handed to
them again for a minute. Anything else lets the theft stand - OnPlayerMount follows, and the horse stays its owner’s
(SetHorseOwner to give it to the thief). The saddlebags stay the owner’s either way.
Syntax
Section titled “Syntax”function OnPlayerStealHorse(pid, id, owner) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the thief |
id |
number | the horse |
owner |
number | whose horse it is |
Returns
Section titled “Returns”false refuses; anything else lets them ride it
Example
Section titled “Example”-- horses are only ever ridden by their owners on this serverfunction OnPlayerStealHorse(pid, id, owner) SendClientMessage(pid, COLOR_RED, "That is " .. GetPlayerName(owner) .. "'s horse.") return falseendSee also
Section titled “See also”SetHorseOwner · GetHorseOwner · OnPlayerMount · the Horses group of the index
