Arivia
Browse ScriptsDownload RLIB
v3.x
v3.x
  • Introduction
  • Select Version
  • Showcase
  • Changelog
    • ◾3.0.0.6-beta
    • ◾3.0.0.5-beta
    • ◾3.0.0.4-beta
    • ◾3.0.0.3-beta
    • ◾3.0.0.2-beta
    • ◾3.0.0.1-alpha
  • FAQ
    • ◾Add Food Categories
    • ◾Addon Won't Show
    • ◾Incompatible Addons
    • ◾Custom Category Colors
    • ◾Hide Unavailable Jobs
    • ◾Modified Script
    • ◾Refunds
    • ◾Script Errors
    • ◾When Are Updates?
  • ❱ Setup
    • ◾Install
    • ◾Verify
    • ◾Workshop
    • ◾Docs/Web
  • ❱ Configuration
    • ◾Env
    • ◾Fonts
    • ◾Languages
    • ◾Settings
      • sh_4_tabs.lua
        • bUseModelImage
        • styleB
    • ◾Visual Blueprints
  • ❱ First Use
    • ◾Binds
    • ◾Console Commands
      • ▸arivia.listjobs
      • ▸arivia.getjob
      • ▸arivia.setjob
  • ❱ Developers
    • ◾Jobs
      • ▸Parameters
        • tip
        • NeedJob
        • NeedGroup
      • ▸Sorting
    • ◾Entities
      • ▸accent
      • ▸allowed
      • ▸customHideUnavail
      • ▸level
      • ▸prestige
      • ▸price
      • ▸tip
    • ◾Food
      • ▸category
    • ◾Categories
      • ▸tip
  • ❱ Internal
    • ◾Rules
    • ◾Web Demo
  • ❱ DOC REFERENCES
    • ◾Status
Powered by GitBook
On this page
  • Alias
  • Source
  • Requires
  • Type
  • Info
  • Example
  • Notes
  1. ❱ Developers
  2. Food

▸category

Groups food into a particular category for better organization.

Alias

category

Source

added in Arivia v3

Requires

no additional requirements

Type

string

Info

By default; darkrp does not offer customization for food categories. Arivia has however added the ability to assign categories to food just like you can for entities, etc.

  • Open lua\modules\arivia\cfg\sh_6_food.lua

  • Locate the table cfg.food.categories

  • Add new category (see example 1 below)

  • Open your darkrp entities file that you wish to add the food item to

  • Add new food item and assign category (see example 2 below)

Example

cfg.food.categories =
{
    [ 'yum' ] =
    {
        name                = 'Yum',
        startExpanded       = true,
        sortOrder           = 1,
        tip                 = 'The good stuff',
    },
}
DarkRP.createFood( 'Bunch of bananas',
{
    model       = "models/props/cs_italy/bananna_bunch.mdl",
    energy      = 20,
    price       = 20,
    category    = 'Yum',
} )

After following the steps above; restart the server and open your F4 menu. You should see the new category and your food item listed within it.

Notes

DarkRP does not handle adding new entities without a restart, and may error out. Ensure you always restart your server if adding new darkrp jobs / entities.

PreviousFoodNextCategories

Last updated 4 years ago

◾