Skip to content

GetHorseItems

What a horse’s saddlebags hold.

As the owner’s game last reported them - or the controller’s, for a horse nobody owns - about once a second after a change, or as SetHorseItems made them. The server forgets every horse when it stops, bags and all: a mode that keeps horses saves this list with GetHorseGear and the breed (GetEntityTemplate), and makes the horse again next time.

GetHorseItems(id)
Parameter Type
id number the horse

table - a list of {class=, amount=, health=} ({} = empty); nil when it is not a horse

local stacks = 0
for _, stack in ipairs(GetHorseItems(horse) or {}) do stacks = stacks + 1 end
SendClientMessage(pid, COLOR_WHITE, "Your saddlebags hold " .. stacks .. " kinds of things.")

SetHorseItems · GetHorseGear · OnHorseItemsChange · GetPlayerHorses · the Horses group of the index