πŸ”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

  1. Install item images Copy everything from the _items folder into your VORP Inventory images directory:

vorp_inventory\html\img\items

These files are the icons used for the coop, chickens and related items (e.g., chicken_good.png, chicken_bad.png, rooster_good.png).

  1. Prepare translations Open config.lua and translate two areas:

  • Database items in createItems() β†’ set label (item name) and desc (item description). These values are inserted into VORP’s items table at server start.

  • UI texts in Config.Txt, and pick your UI language via Config.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, ...)
end
  • label β†’ inventory display name (e.g., "Chicken").

  • desc β†’ inventory tooltip/description (e.g., "Healthy chicken"). These fields are written into the VORP items table 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.NUILang selects the language used by the NUI (front-end).

  • Config.Txt holds the text displayed to players in the interface.


βœ… Quick Checklist

  • _items β†’ vorp_inventory\html\img\items copied.

  • createItems() labels/descriptions translated.

  • Config.NUILang set and Config.Txt translated.

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