Skip to content

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.

function OnPlayerStealHorse(pid, id, owner)
-- ...
end
Parameter Type
pid number the thief
id number the horse
owner number whose horse it is

false refuses; anything else lets them ride it

-- horses are only ever ridden by their owners on this server
function OnPlayerStealHorse(pid, id, owner)
SendClientMessage(pid, COLOR_RED, "That is " .. GetPlayerName(owner) .. "'s horse.")
return false
end

SetHorseOwner · GetHorseOwner · OnPlayerMount · the Horses group of the index