Features

Stables

The Stables app: My horses and My wagons, choosing and calling a horse, which stable scripts are supported, and Config.Stables.

Stables (stables) lists the horses and wagons a character owns in your stable script. It connects to the stable script through FXStables in framework/frameworks.lua. Settings are in apps/stables/config.lua (Config.Stables).

#What the player can do

The app has two tabs.

My horses

  • Every horse with its name, breed, sex, the stable it stands in, health, and whether it is alive. A dead horse stays on the list with its record.
  • Make active: picks the horse a whistle brings. Supported on vorp_stables and rsg-horses, and on gum_stables only when Gum.AllowSetActive = true.
  • Call: makes the horse active and brings it to the player. Supported on rsg-horses (Rsg.AllowCall). After a call the button waits CallCooldown seconds.

When the stable script cannot do an action, the button is not offered and the horses are only listed.

My wagons

  • Every wagon with its name, kind, stable, and whether it is in use. When the stable script keeps a condition, it is shown as a percentage; under 40 % the wagon reads "Needs repair".
  • The list is read only. Wagons are taken out and put back at a stable.

The tab is shown when Wagons = true and the stable script keeps wagons.

#Supported stable scripts

Mode Script Horses Make active Call Wagons
rsg rsg-horses (and rsg-wagons for wagons) Yes Yes Yes Yes, when rsg-wagons runs
vorp vorp_stables Yes Yes No Yes (rows of type cart)
gum gum_stables Yes Only with Gum.AllowSetActive = true No Yes
internal none Not connected No No No
custom your own You write it You write it You write it You write it

Mode = 'auto' picks rsg when RSG and rsg-horses run, gum when VORP and gum_stables run, vorp when VORP and vorp_stables run, otherwise internal. In internal the app says the stable system is not connected.

#What it needs

Need Notes
A stable script One of the scripts above, or a custom adapter
Signal Only for make active and call, and only when RequireSignal = true

#Settings

Key Default What it does
Enabled true Turns the app on
Mode 'auto' auto, vorp, rsg, gum, internal or custom
RequireSignal false Make active and call need a signal
CallCooldown 15 Seconds before the same character can call a horse again
ModelLabels {} Breed names by model. Without one, the name is made from the model (A_C_Horse_Turkoman_DarkBay reads "Turkoman DarkBay")
Wagons true The My wagons tab
WagonLabels {} Wagon names by model. Empty: the book names the wagon from its model
Gum.AllowSetActive false Change the selected horse of gum_stables by SQL. Leave off until you have tested it in game
Gum.StableNames nil Stable names by number. Empty: read from gum_stables/cfg/configCoords.lua
Vorp.AllowSetActive true Change the default horse of vorp_stables
Rsg.AllowCall true Call the horse on rsg-horses
Rsg.StableNames {} Stable names by key, for rsg-horses and rsg-wagons
luaModelLabels = { A_C_Horse_Arabian_White = 'Arap Beyaz' },
WagonLabels = { cart04 = 'Ciftlik arabasi' },
Rsg = { AllowCall = true, StableNames = { valentine = 'Valentine Ahiri' } },

#Another stable script

Set Mode = 'custom' and fill in customStables in framework/frameworks.lua. Available and List are required. Call, SetActive and Wagons are optional: leave one out and the app does not offer it.

luafunction customStables.Available()
    return GetResourceState('my_stables') == 'started'
end
function customStables.List(src, char)
    return { { id = 1, name = 'Duman', model = 'A_C_Horse_Arabian_White', label = 'Arabian White', active = true } }
end
function customStables.Wagons(src, char)
    return { { id = 1, name = 'Yuk arabasi', model = 'cart04', active = true, condition = 90 } }
end
function customStables.Call(src, char, horseId)
    TriggerClientEvent('my_stables:client:callHorse', src, horseId)
    return true
end

A horse row may carry id, name, model, label, gender, stable, active, health and dead. A wagon row may carry id, name, model, label, stable, active and condition (0 to 100). Ids are the stable script's own numeric ids.