🐔Chicken Coop
A lightweight chicken-coop system for RedM designed to work with VORP Inventory. This page walks you through first setup and translations.
⚡ First Start
Install item images Copy everything from the
_itemsfolder into your VORP Inventory images directory:
vorp_inventory\html\img\itemsThese files are the icons used for the coop, chickens and related items (e.g., chicken_good.png, chicken_bad.png, rooster_good.png).
Prepare translations Open
config.luaand translate two areas:
Database items in
createItems()→ setlabel(item name) anddesc(item description). These values are inserted into VORP’sitemstable at server start.UI texts in
Config.Txt, and pick your UI language viaConfig.NUILang(supported: fr, en, de, it, es, pt).
Tip: Start/Restart the server to let
createItems()run and (re)inject the items into the database. (This follows from the script inserting items “when the server starts.”)
🧩 Database Items (createItems)
In config.lua, edit createItems() so your item names/descriptions match your language:
function createItems()
exports.oxmysql:execute("INSERT INTO items (...)",
{"chicken_good","Chicken",5,1,"item_standard",0,1,"{}","Healthy chicken",1.0,0}
)
-- duplicate for other items (injured chicken, rooster, meat, coop, ...)
endlabel→ inventory display name (e.g.,"Chicken").desc→ inventory tooltip/description (e.g.,"Healthy chicken"). These fields are written into the VORPitemstable at startup.
🌍 UI Localization
Set the NUI language and translate the visible strings:
-- translate.js provides: fr, en, de, it, es, pt
Config.NUILang = "en"
Config.Txt = {
Title = "Chicken Coop",
OpenCoop = "Open the coop",
StallName = "Coop name",
-- ...
}Config.NUILangselects the language used by the NUI (front-end).Config.Txtholds the text displayed to players in the interface.
✅ Quick Checklist
_items→vorp_inventory\html\img\itemscopied.createItems()labels/descriptions translated.Config.NUILangset andConfig.Txttranslated.
You’re ready to launch the script and see the coop items and UI in your chosen language.
Here is an excerpt from the config.lua file : (parts of the excerpt are hidden) :
Config = {}
Config.DEBUG = false -- 5s = 1 day
Config.SpamSeconds = 2
-- KEYBIND CONFIGURATION
Config.OpenCoop = keys["U"] -- Key to open a chicken coop
Config.CraftObject = keys["U"] -- Key to place/confirm creation
Config.ChangeDistance = keys["DOWN"] -- Move the coop closer or further when placing
Config.RotateLeft = keys["LEFT"] -- Rotate coop left while placing
Config.RotateRight = keys["RIGHT"] -- Rotate coop right while placing
Config.Cancel = keys["R"] -- Cancel placement
function createItems()
--
end
-- CAPACITY & MODELS
Config.MaxAnimals = 5
Config.StreamDistance = 100.0
Config.DespawnDistance = 110.0
Config.Models = {
--
}
Config.Items = {
--
}
Config.FoodAllowed = {
"corn",
"water"
}
Config.NUILang = "en" -- translate.js -> fr, en, de, it, es, pt
-- TRANSLATED TEXTS
Config.Txt = {
Title = "Chicken Coop",
OpenCoop = "Open the coop",
--
}
-- PRODUCTION
Config.Production = {
Prairie = { chance1 = 0.90, chance2 = 0.50 },
LowChicken = { chance1 = 0.70, chance2 = 0.20 },
RoosterChickChance = 0.10, -- per in-game day
ChickAdultChance = 0.10, -- per in-game day
}
-- DIRTINESS
Config.DirtDailyPerAnimalMin = 1
Config.DirtDailyPerAnimalMax = 2
-- DISEASES / DEATH
Config.SicknessAt100 = 0.10 -- per in-game day (if dirt == 100)
Config.DeathIfSick = 0.10 -- per in-game day (sick animal)
Config.DeathIfSickChick= 0.20 -- per in-game day (sick chick)
Config.HealIfBelow100 = 0.10 -- per in-game day / sick animal (if dirt < 100)
-- FOX EVENT (optional)
Config.EnableFoxEvent = true
Config.FoxAttackChanceNight = 0.01 -- every 5s, all night, if chickens are outside
Config.FoxKillMin = 1
Config.FoxKillMax = 1
-- IN-GAME DAY & TIME CONVERSION
-- 1s IRL = 30s IG => 24h IG = 48min IRL
Config.DayStartHour = 6
Config.DayEndHour = 20
Config.RequiredOutsideFraction = 0.50
-- => 6->20 = 14h IG = 28min IRL ; threshold = 14min IRL
Last updated