All resources

rsg-ranch — Developer Docs#

Dependencies#

rsg-core, rsg-inventory, rsg-target, rsg-wellpump, oxmysql. No ox_lib or rsg-multijob (removed in 3.2.0; multijob is built into rsg-core).

Framework APIs used (rsg-core replacements for ox_lib)#

PurposeUsed in rsg-ranch
Locales@rsg-core/shared/locale.lua in shared_scripts, locale('key'). Language: setr rsg:locale <code> (falls back to ox:locale, then en). NUI strings read locales/<lang>.json with the same convar order (GetUiLocales in client/modules/ranchui.lua).
Notify (client)RSGCore.Functions.Notify({ title, description, type, duration }) (exports['rsg-core']:Notify where RSGCore isn't loaded)
Notify (server)TriggerClientEvent('RSGCore:Client:Notify', src, data)
Server callbacksLocal RegisterCallback(name, fn) wrapper in each server file → RSGCore.Functions.CreateCallback; handlers simply return their values. Client side: RSGCore.Functions.AwaitCallback(name, nil, ...)
Client callbackrsg-ranch:client:requestConsent via RSGCore.Functions.CreateClientCallback, called with RSGCore.Functions.TriggerClientCallback
CronRSGCore.Functions.CreateCron(Config.AnimalCronJob / AnimalFeedWaterCronJob / ChickenCoopFeedCronJob, job)
ModelsRSGCore.Functions.RequestModel(model, timeout)
Water bucketexports['rsg-wellpump']:TakeBucketUse / CommitBucketUse / RefundBucketUse (water trough refills)
Targetingexports['rsg-target']:addLocalEntity / removeLocalEntity
MultijobRSGCore.Functions.AddPlayerJob(citizenid, job, grade) / RemovePlayerJob(citizenid, job) (wrapped as MultijobAddJob/MultijobRemoveJob in server/server.lua); ranch job definitions created/removed live with RSGCore.Functions.SaveJobDefinition / DeleteJobDefinition (rsg-core 3.1.6+, SQL fallback for older cores)
Player pedPlayerPedId() (replaces cache.ped)

Context menus and alert dialogs are this resource's own NUI (client/menu.lua → Menu.registerContext/showContext/hideContext/alertDialog, html/app.js).

Changelog#

  • 3.2.0 — Migrated off ox_lib to rsg-core (locales, notify, callbacks, cron, progress bar, text UI, model loading); ox_target → rsg-target; rsg-multijob exports → rsg-core multijob functions.

rsg-economy integration#

RanchEcon.Quote(src, price) calls exports['rsg-economy']:Quote(src, { region = GetRegionAt(player coords), mode = 'sell', base = price, qty = 1, market = false }) and returns the new price plus the quote; RanchEcon.Record(src, quote) runs after AddMoney. Used in the three sale paths (sellAnimal, bulk herd sale, sellAtRanch). Region is derived server-side from the player's position. Config: Config.Economy.Enabled.

rsg-skills integration#

Config.Skills = { Enabled, Skill, SellXP, SellBonus }. The global table RanchSkills (top of server/server.lua, a table because the file is close to Lua's local-variable limit) has Active(), Price(src, price) and SoldXP(src, count). Price multiplies the server-computed price by 1 + GetPerk(src, 'ranching', 'sell_bonus') / 100, rounded to the cent, before the money is paid and shown. SoldXP calls AddXP(src, 'ranching', SellXP * count, 'ranch animal sale'). The extra_yield perk is not applied by this script. Skipped when rsg-skills is not started.

<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-ranch 3.3.0. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core, rsg-inventory, rsg-target, rsg-wellpump, oxmysql

Database#

Tables: rsg_ranch_animals, rsg_ranch_feedtroughs, rsg_ranch_storages, rsg_ranch_owners, rsg_ranch_watertroughs, rsg_ranch_orders, rsg_ranch_chickencoops, rsg_ranch_settings, rsg_ranch_custom.

Tables are created automatically on start while Config.AutoDatabase = true (default). Nothing is ever dropped or overwritten. For a manual install set Config.AutoDatabase = false and import installation/rsg-ranch.sql once.

-- shared/config.lua
Config.AutoDatabase = true -- false = import the SQL file yourself

Configuration#

OptionDefaultNotes
Config.AutoDatabasetruebuild the database tables automatically on start (set false and import the SQL file for a manual install)
Config.Debugfalse
Config.ANIMAL_ID_MIN100000
Config.ANIMAL_ID_MAX999999
Config.FALLBACK_ID_SUFFIX_MIN1000
Config.FALLBACK_ID_SUFFIX_MAX9999
Config.MAX_ID_LENGTH20
Config.DistanceSpawn50.0
Config.FadeIntrue
Config.StorageMinJobGrade1
Config.RanchStorageMaxWeight10000000
Config.RanchStorageMaxSlots100
Config.RanchStorageSizestableadditional storage is its own separate stash and can be renamed by the boss.
Config.MaxAdditionalStorages5a single ranch can purchase. Set to 0 for unlimited.
Config.RanchStorageAccessLevelstableShown to the boss in the order listed here.
Config.AnimalFadeIntrue
Config.ServerNotifytrue
Config.AnimalCronJob'*/15 * * * *'every 15 minutes
Config.AnimalFeedWaterCronJob'*/15 * * * *'how often troughs feed/water animals (separate from the main survival cronjob above, so you can tune feed/wate
Config.MaxRanchAnimals10
Config.UpdateClientsOnCrontrueUpdate client animal data when cronjob runs
Config.RefreshAfterCrontrueFull refresh of animal data after cronjob completion
Config.AnimalBlipsEnabledtrueranch's own staff ever see its animals on the map, never other players or other ranches.
Config.AnimalBlipSprite'blip_ambient_companion'RDR3 blip sprite name used for animal blips
Config.AnimalBlipScale0.15
Config.AnimalBlipRefreshInterval5000how often (ms) to re-check job/staff status and add/remove blips accordingly
Config.HungerDecayRate1hunger reduction per cronjob run
Config.ThirstDecayRate1thirst reduction per cronjob run
Config.HealthDecayRate1health reduction per cronjob run when starving/dehydrated
Config.MinSurvivalStats0minimum hunger/thirst before health starts decaying
Config.HealthRegenerationRate5health regeneration per cronjob run when well-fed and watered
Config.MinStatsForRegeneration80minimum hunger/thirst required for health regeneration
Config.AutoFeedRestoreAmount100hunger restored per cronjob run while the ranch has an active feed trough
Config.AutoWaterRestoreAmount100thirst restored per cronjob run while the ranch has an active water trough
Config.AnimalWanderingEnabledtrueEnable animals to wander naturally
Config.WanderRadius30.0Maximum distance animals can wander from spawn point
Config.WanderMinDistance3.0Minimum distance for a wander movement
Config.WanderSpeed1.0Movement speed while wandering (1.0 = walk, 2.0 = jog)
Config.WanderIdleTimeMin10000Minimum time (ms) standing still before wandering
Config.WanderIdleTimeMax30000Maximum time (ms) standing still before wandering
Config.WanderMoveTimeMin5000Minimum time (ms) spent moving
Config.WanderMoveTimeMax15000Maximum time (ms) spent moving
Config.WanderCheckInterval2000How often to update wander behavior (ms)
Config.WanderPositionSaveInterval30000How often (ms) a freely wandering animal's position is synced back to the database, so a script/server restart
Config.WaterItem'fullbucket'full water bucket used to refill water troughs (filled at an rsg-wellpump pump; must match rsg-wellpump's Config.FullItem). The bucket's uses and the empty bucket handed back are set in rsg-wellpump
Config.FeedTroughItem'feedtrough'item used to place a feed trough
Config.FeedTroughModelp_feedtroughsml01xprop model used for placed feed troughs
Config.FeedTroughUses100number of times a feed trough can be fed from before it is removed
Config.FeedTroughFeedAmount100hunger restored (up to 100) each time an animal feeds from a feed trough
Config.FeedTroughHungerThreshold10animals will only seek out a feed trough once hunger drops below this
Config.FeedTroughSearchRadius100.0radius (from an animal's position) to search for a usable feed trough
Config.FeedTroughInteractDistance2.0distance an animal must reach before it can feed from a feed trough
Config.FeedTroughPlaceDistance2.5distance in front of the player where a feed trough is placed
Config.FeedTroughHeadingOffset0.0degrees added to the stored heading when (re)spawning the prop, to correct for the model's default pivot facin
Config.FeedBagItem'feedbag'item used to refill a feed trough (consumed like the water bucket is for water troughs, minus the fill-up step
Config.FeedTroughRefillPerBagUse100uses added to a feed trough per feedbag consumed when refilling
Config.FEEDTROUGH_ID_MIN100000
Config.FEEDTROUGH_ID_MAX999999
Config.WaterTroughItem'watertrough'item used to place a water trough
Config.WaterTroughModelp_watertrough01xprop model used for placed water troughs
Config.WaterTroughUses100number of times a water trough can be drunk from before it runs dry
Config.WaterTroughDrinkAmount100thirst restored (up to 100) each time an animal drinks from a trough
Config.WaterTroughThirstThreshold10animals will only seek out a water trough once thirst drops below this
Config.WaterTroughSearchRadius100.0radius (from an animal's position) to search for a usable water trough
Config.WaterTroughInteractDistance2.0distance an animal must reach before it can drink from a water trough
Config.WaterTroughPlaceDistance2.5distance in front of the player where a water trough is placed
Config.WaterTroughRefillPerBucketUse100uses added to a trough per water bucket use consumed when refilling
Config.WaterTroughHeadingOffset0.0degrees added to the stored heading when (re)spawning the prop, to correct for the model's default pivot facin
Config.WATERTROUGH_ID_MIN100000
Config.WATERTROUGH_ID_MAX999999
Config.ChickenCoopItem'chickencoop'item used to place a chicken coop cart
Config.ChickenCoopModelp_chickencoopcart01xprop model used for placed chicken coops
Config.ChickenModelA_C_Chicken_01ped model spawned for each chicken owned by a coop
Config.ChickenCoopPlaceDistance2.5distance in front of the player where a chicken coop is placed
Config.ChickenCoopInteractDistance2.5distance a player must be within to interact with a chicken coop
Config.ChickenBuyPrice15cash cost to buy a single chicken for a coop
Config.MaxChickensPerCoop20maximum number of chickens a single coop can hold
Config.ChickenWanderRadius10.0maximum distance chicken peds will wander from their coop
Config.ChickenWanderCheckInterval4000ms between wander decisions per chicken
Config.EggProductionInterval1800seconds per egg production cycle (30 minutes)
Config.EggsPerChickenPerCycle1eggs produced per chicken, per production cycle, if it successfully lays
Config.ChickenEggChance0.75probability (0.0-1.0) that a given chicken lays eggs on a given production cycle
Config.MaxEggsStored100cap on eggs a coop can bank before it needs collecting
Config.EggItem'egg'item given to players when collecting eggs
Config.ChickenCoopHeadingOffset0.0degrees added to the stored heading when (re)spawning the coop prop, to correct for the model's default pivot
Config.CHICKENCOOP_ID_MIN100000
Config.CHICKENCOOP_ID_MAX999999
Config.ChickenCoopMaxFeedLevel100feed level a coop starts at / tops out at
Config.ChickenCoopFeedDecayInterval2592seconds per feed decay cycle (43.2 minutes)
Config.ChickenCoopFeedDecayAmount1feed level lost per decay cycle - at the defaults (100 feed, 1 point every 2592s) a full coop takes exactly 3
Config.ChickenCoopFeedPerBag100feed level restored per feed bag used to feed the coop
Config.ChickenCoopFeedCronJob'*/15 * * * *'how often the server checks coops for feed decay/starvation (every 15 minutes) - decay itself is time-based (s
Config.HerdingEnabledtrue
Config.HerdingKey''Default key for a rebindable shortcut that runs /herd (rsg-core RegisterKey, rsg-core 3.6.0+). '' = unbound until the player binds it, nil = no key mapping
Config.HerdingDistance25.0maximum distance to detect animals for herding
Config.HerdingMaxAnimals10maximum number of animals that can be herded at once
Config.HerdingFollowDistance3.0distance animals maintain while following during herding
Config.HerdingSpeed1.5movement speed when herding animals
Config.HerdingTimeout300seconds before herding automatically stops (5 minutes)
Config.RequireHerdingToolfalseset to true if you want to require a specific item to herd
Config.HerdingTool'weapon_lasso'item required for herding (if RequireHerdingTool is true)
Config.IndividualSelectionEnabledtrueenable individual animal selection for herding
Config.ShowAnimalDistancetrueshow distance to animals in selection menu
Config.SelectionRangeMultiplier1.5multiplier for selection range vs herding distance
Config.BullBuyPrice100
Config.CowBuyPrice50
Config.PigBuyPrice40
Config.PigDeliveryOnlytruepigs can only be bought with delivery to the ranch, no drive-yourself pickup option
Config.PigChooseGenderOnBuytruelet the buyer pick male/female when purchasing a pig, instead of it being randomized
Config.SheepBuyPrice35
Config.SheepDeliveryOnlytruesheep follow the same buy rules as pigs: delivery to the ranch only, no drive-yourself pickup option
Config.SheepChooseGenderOnBuytruelet the buyer pick male/female when purchasing a sheep, instead of it being randomized
Config.LivestockDeliveryPrice10extra cost charged when the player pays to have a purchased animal delivered straight to their ranch spawnpoin
Config.AnimalSpeciestable
Config.PigSlaughterYield{ min = 2, max = 4 }joints of pork produced when a pig is sent for slaughter
Config.PorkJointItem'porkjoint'item given for each joint of pork produced
Config.CowSlaughterYield{ min = 3, max = 6 }joints of beef produced when a cow is sent for slaughter
Config.BullSlaughterYield{ min = 4, max = 8 }joints of beef produced when a bull is sent for slaughter
...70 more options in the config files

Exports#

Server

ExportArgumentsFile
isPlayerRanchStaffplayerIdserver/exports.lua
getPlayerRanchIdplayerIdserver/exports.lua
getRanchAnimalCountranchidserver/exports.lua
getRanchAnimalsranchidserver/exports.lua
getAnimalDataanimalidserver/exports.lua
addAnimalToRanchranchid, model, gender, pos_x, pos_y, pos_z, pos_wserver/exports.lua
removeAnimalFromRanchanimalidserver/exports.lua
updateAnimalStatsanimalid, statsserver/exports.lua
getStaffCountranchidserver/exports.lua
getRanchStatisticsranchidserver/exports.lua
CreateAnimalId``server/server.lua

Client

ExportArgumentsFile
isLocalPlayerRanchStaff``client/exports.lua
getLocalPlayerRanchId``client/exports.lua
getRanchLocationranchidclient/exports.lua
getAllRanchLocations``client/exports.lua
getAllSalePointLocations``client/exports.lua
getAllBuyPointLocations``client/exports.lua
getNearestRanch``client/exports.lua
canInteractWithAnimalanimalidclient/exports.lua
getAnimalProductInfoanimalModelclient/exports.lua
getBreedingConfiganimalModelclient/exports.lua
getPlayerJobGrade``client/exports.lua
hasPermissionpermissionNameclient/exports.lua
getNearestWaterSource``client/exports.lua
isNearRanchmaxDistanceclient/exports.lua
GetAnimalEntityById``client/modules/animals.lua
GetAnimalDataCache``client/modules/animals.lua
GetNearestFeedTrough``client/modules/feedtrough.lua
StartPropPlacement``client/modules/propplacer.lua
IsPropPlacementActive``client/modules/propplacer.lua
GetNearestWaterTrough``client/modules/watertroughs.lua
-- example
local result = exports['rsg-ranch']:isPlayerRanchStaff(playerId)

Callbacks#

CallbackSideArgumentsFile
rsg-ranch:client:requestConsentclientcb, header, content, timeoutclient/modules/ranchui.lua
rsg-ranch:server:getRanchSettingsserver``server/modules/admin.lua
rsg-ranch:admin:getOverviewserversrcserver/modules/admin.lua
rsg-ranch:admin:getRanchserversrc, ranchidserver/modules/admin.lua
rsg-ranch:admin:createRanchserversrc, dataserver/modules/admin.lua
rsg-ranch:admin:actionserversrc, ranchid, kind, dataserver/modules/admin.lua
rsg-ranch:admin:searchPlayersserversrc, queryserver/modules/admin.lua
rsg-ranch:server:getSupplyOrdersserversource, cb, ranchidserver/modules/orders.lua
rsg-ranch:server:getranchstoragesserversource, cb, ranchidserver/server.lua
rsg-ranch:server:getChickenCoopStatusserversource, cb, coopidserver/server.lua
rsg-ranch:server:countanimalsserversrc, cb, ranchidserver/server.lua
rsg-ranch:server:getAnimalProductionStatusserversrc, cb, animalidserver/server.lua
rsg-ranch:server:getAnimalOverviewserversrc, cb, ranchidserver/server.lua
rsg-ranch:server:getBreedingStatusserversrc, cb, animalidserver/server.lua
rsg-ranch:server:getPregnancyProgressserversrc, cb, animalidserver/server.lua
rsg-ranch:server:getAvailableAnimalsForBreedingserversrc, cb, ranchid, animalidserver/server.lua
rsg-ranch:server:getNearbyAnimalsForSaleserversrc, cb, ranchid, salePointCoordsserver/server.lua
rsg-ranch:server:getranchownerserversource, cb, ranchidserver/server.lua
rsg-ranch:server:getRanchSellQuoteserversource, cb, ranchidserver/server.lua
rsg-ranch:server:getStaffListserversource, cb, ranchidserver/server.lua
rsg-ranch:server:getNearbyPlayersserversrc, cbserver/server.lua
rsg-ranch:server:getRanchMarketserversrc, cb, ranchidserver/server.lua
-- client side
RSGCore.Functions.TriggerCallback('rsg-ranch:client:requestConsent', function(result)
    -- use result
end)

Events#

Server events can be fired by any client, so every handler re-validates the player, the arguments and any permission, distance or cooldown on the server. Never add a reward to a handler without those checks.

EventSideArgumentsFile
rsg-ranch:client:applyRanchSettingsclientsettingsclient/client.lua
rsg-ranch:client:openranchclientranchid, jobaccessclient/client.lua
rsg-ranch:client:openAdminclient``client/modules/admin.lua
rsg-ranch:client:forceRespawnAnimalclientanimalIdclient/modules/animals.lua
RSGCore:Client:OnPlayerLoadedclient``client/modules/animals.lua
rsg-ranch:client:spawnAnimalsclientanimalData, isFullListclient/modules/animals.lua
rsg-ranch:client:spawnAnimalGrantedclientanimalId, animalData, networkId, isCreatorclient/modules/animals.lua
rsg-ranch:client:spawnAnimalDeniedclientanimalId, reasonclient/modules/animals.lua
rsg-ranch:client:removeAnimalclientanimalidclient/modules/animals.lua
rsg-ranch:client:refreshSingleAnimalclientanimalid, updatedDataclient/modules/animals.lua
rsg-ranch:client:refreshAnimalsBatchclientupdatesclient/modules/animals.lua
rsg-ranch:client:setAnimalTransportingclientanimalIds, transportingclient/modules/animals.lua
rsg-ranch:client:animalmenuclientanimal, dataclient/modules/animals.lua
rsg-ranch:client:actionsmenuclientdataclient/modules/animals.lua
rsg-ranch:client:animalsendfeedclientdataclient/modules/animals.lua
rsg-ranch:client:animalsendwaterclientdataclient/modules/animals.lua
rsg-ranch:client:animalfollowclientdataclient/modules/animals.lua
rsg-ranch:client:checkProductsclientdataclient/modules/animals.lua
rsg-ranch:client:collectProductclientdataclient/modules/animals.lua
rsg-ranch:client:findBreedingPartnerclientdataclient/modules/animals.lua
rsg-ranch:client:confirmBreedingclientdataclient/modules/animals.lua
rsg-ranch:client:startChickenCoopPlacementclient``client/modules/chickencoop.lua
rsg-ranch:client:spawnChickenCoopsclientcoopListclient/modules/chickencoop.lua
rsg-ranch:client:spawnChickenCoopclientdataclient/modules/chickencoop.lua
rsg-ranch:client:removeChickenCoopclientcoopidclient/modules/chickencoop.lua
rsg-ranch:client:updateChickenCoopclientcoopid, chickensclient/modules/chickencoop.lua
rsg-ranch:client:startFeedTroughPlacementclient``client/modules/feedtrough.lua
rsg-ranch:client:startFeedTroughMoveclientfeedtroughidclient/modules/feedtrough.lua
rsg-ranch:client:moveFeedTroughclientfeedtroughid, pos_x, pos_y, pos_z, pos_wclient/modules/feedtrough.lua
rsg-ranch:client:spawnFeedTroughsclientfeedtroughListclient/modules/feedtrough.lua
rsg-ranch:client:spawnFeedTroughclientdataclient/modules/feedtrough.lua
rsg-ranch:client:removeFeedTroughclientfeedtroughidclient/modules/feedtrough.lua
rsg-ranch:client:updateFeedTroughUsesclientfeedtroughid, usesclient/modules/feedtrough.lua
rsg-ranch:client:openHerdingMenuclient``client/modules/herding.lua
rsg-ranch:client:showTypeMenuclient``client/modules/herding.lua
rsg-ranch:client:showIndividualSelectionMenuclient``client/modules/herding.lua
rsg-ranch:client:toggleAnimalSelectionclientdataclient/modules/herding.lua
rsg-ranch:client:clearAnimalSelectionclient``client/modules/herding.lua
rsg-ranch:client:startSelectedHerdingclient``client/modules/herding.lua
rsg-ranch:client:startDistanceHerdingclient``client/modules/herding.lua
rsg-ranch:client:startTypeHerdingclientdataclient/modules/herding.lua
rsg-ranch:client:stopHerdingclient``client/modules/herding.lua
rsg-ranch:client:openmanagermenuclientranchidclient/modules/ranchui.lua
rsg-ranch:client:openranchhandmenuclientranchidclient/modules/ranchui.lua
rsg-ranch:client:opentraineemenuclientranchidclient/modules/ranchui.lua
rsg-ranch:client:openpurchasemenuclientranchidclient/modules/ranchui.lua
rsg-ranch:client:openSaleMenuclientsalePointDataclient/modules/salepoint.lua
rsg-ranch:client:startWaterTroughPlacementclient``client/modules/watertroughs.lua
rsg-ranch:client:startWaterTroughMoveclientwatertroughidclient/modules/watertroughs.lua
rsg-ranch:client:moveWaterTroughclientwatertroughid, pos_x, pos_y, pos_z, pos_wclient/modules/watertroughs.lua
rsg-ranch:client:spawnWaterTroughsclientwatertroughListclient/modules/watertroughs.lua
rsg-ranch:client:spawnWaterTroughclientdataclient/modules/watertroughs.lua
rsg-ranch:client:removeWaterTroughclientwatertroughidclient/modules/watertroughs.lua
rsg-ranch:client:updateWaterTroughUsesclientwatertroughid, usesclient/modules/watertroughs.lua
rsg-ranch:server:placeSupplyOrderserveritemName, amountserver/modules/orders.lua
rsg-ranch:server:collectSupplyOrderserverorderidserver/modules/orders.lua
rsg-ranch:server:openranchstorageserverdataserver/server.lua
rsg-ranch:server:purchaseranchstorageserverdataserver/server.lua
rsg-ranch:server:renameranchstorageserverdataserver/server.lua
rsg-ranch:server:setstorageaccessserverdataserver/server.lua
rsg-ranch:server:placeFeedTroughserverpos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:refreshFeedTroughsserver``server/server.lua
rsg-ranch:server:refillFeedTroughserverfeedtroughidserver/server.lua
rsg-ranch:server:requestMoveFeedTroughserverfeedtroughidserver/server.lua
rsg-ranch:server:confirmMoveFeedTroughserverfeedtroughid, pos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:deleteFeedTroughserverfeedtroughidserver/server.lua
rsg-ranch:server:placeWaterTroughserverpos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:refreshWaterTroughsserver``server/server.lua
rsg-ranch:server:refillWaterTroughserverwatertroughidserver/server.lua
rsg-ranch:server:requestMoveWaterTroughserverwatertroughidserver/server.lua
rsg-ranch:server:confirmMoveWaterTroughserverwatertroughid, pos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:deleteWaterTroughserverwatertroughidserver/server.lua
rsg-ranch:server:placeChickenCoopserverpos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:refreshChickenCoopsserver``server/server.lua
rsg-ranch:server:buyChickenservercoopidserver/server.lua
rsg-ranch:server:collectEggsservercoopidserver/server.lua
rsg-ranch:server:deleteChickenCoopservercoopidserver/server.lua
rsg-ranch:server:feedChickenCoopservercoopidserver/server.lua
rsg-ranch:server:requestAnimalSpawnserveranimalId, animalDataserver/server.lua
rsg-ranch:server:registerAnimalNetworkIdserveranimalId, networkIdserver/server.lua
rsg-ranch:server:refreshAnimalsserver``server/server.lua
rsg-ranch:server:saveAnimalPositionserveranimalid, pos_x, pos_y, pos_z, pos_wserver/server.lua
rsg-ranch:server:respawnAnimalserveranimalIdserver/server.lua
rsg-ranch:server:reportDespawnserveranimalIdserver/server.lua
rsg-ranch:server:collectProductserveranimalidserver/server.lua
rsg-ranch:server:sendAnimalToFeedserveranimalid, feedtroughidserver/server.lua
rsg-ranch:server:sendAnimalToWaterserveranimalid, watertroughidserver/server.lua
rsg-ranch:server:sellAnimalserveranimalidserver/server.lua
rsg-ranch:server:sellAllAnimalsserveranimalIdsserver/server.lua
rsg-ranch:server:buyAnimalserverpurchaseDataserver/server.lua
rsg-ranch:server:purchaseRanchserverranchidserver/server.lua
rsg-ranch:server:transferRanchOwnershipserverranchid, targetIdserver/server.lua
rsg-ranch:server:sellRanchserverranchidserver/server.lua
rsg-ranch:server:startBreedingserveranimal1id, animal2idserver/server.lua
rsg-ranch:server:hireEmployeeserverranchid, targetId, gradeserver/server.lua
rsg-ranch:server:fireEmployeeserverranchid, targetCitizenidserver/server.lua
rsg-ranch:server:promoteEmployeeserverranchid, targetCitizenidserver/server.lua
rsg-ranch:server:demoteEmployeeserverranchid, targetCitizenidserver/server.lua
rsg-ranch:server:sellAtRanchserveranimalidserver/server.lua
rsg-ranch:server:slaughterAtRanchserveranimalidserver/server.lua
-- from a client script
TriggerServerEvent('rsg-ranch:server:placeSupplyOrder', itemName, amount)
-- from a server script
TriggerClientEvent('rsg-ranch:client:applyRanchSettings', source, settings)

Commands#

CommandNotesFile
/cleanupranchanimalsclient/modules/animals.lua
/testproductionclient/modules/animals.lua
/validatemenuclient/modules/animals.lua
/herdclient/modules/herding.lua
/herdselectstatusclient/modules/herding.lua
/herdclearclient/modules/herding.lua

Locales#

Language files in locales/: de, el, en, es, fr, ja, nl, pl, pt-br, ro, ru. Set the language with setr rsg:locale "en".

<!-- END AUTO-REFERENCE -->