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.
Syntax
Section titled “Syntax”GetHorseItems(id)| Parameter | Type | |
|---|---|---|
id |
number | the horse |
Returns
Section titled “Returns”table - a list of {class=, amount=, health=} ({} = empty); nil when it is not a horse
Example
Section titled “Example”local stacks = 0for _, stack in ipairs(GetHorseItems(horse) or {}) do stacks = stacks + 1 endSendClientMessage(pid, COLOR_WHITE, "Your saddlebags hold " .. stacks .. " kinds of things.")See also
Section titled “See also”SetHorseItems · GetHorseGear · OnHorseItemsChange · GetPlayerHorses · the Horses group of the index
