Skip to content

GetCartPartSlots

The slots a cart of a kind has - a shop’s menu.

GetCartPartSlots([kind])
Parameter Type
kind string the cart’s kind; nil = "wagon" (optional)

table - the wagon’s {"body", "axle", "wheels", "load", "horse1", "horse2"}, the two-wheeler’s {"body", "wheels", "load", "horse1"}; {} for no such kind

-- a shop's menu for the cart the player stands by
local kind = GetEntityTemplate(cart)
for _, slot in ipairs(GetCartPartSlots(kind)) do
SendClientMessage(pid, COLOR_WHITE, slot .. ": " .. table.concat(GetCartPartNames(slot, kind), ", "))
end

GetCartPartNames · SetCartPart · the Carts group of the index