Skip to content

GetHorseItems

What a horse’s saddlebags hold.

The server’s record of the saddlebags: what SetHorseItems made them, changed by what the player whose game holds them moved in or out and the server accepted. The record is the server’s whoever holds the bags, and a player whose game shows more in the saddlebags than this has the excess taken out under [audit] mode = "enforce". 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. One of the mode’s tagged items (GivePlayerTaggedItem) in the bags is an entry of its own with its id, name and text - save them with it, and SetHorseItems puts it back with its tag.

GetHorseItems(id)
Parameter Type
id number the horse

table - a list of {class=, amount=, health=, quality=} (quality when known; a tagged item also id=, name=, text=; {} = 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