{"id":140,"date":"2025-02-04T05:10:21","date_gmt":"2025-02-04T05:10:21","guid":{"rendered":"https:\/\/0resmon.com\/blog\/?p=140"},"modified":"2025-02-04T05:10:21","modified_gmt":"2025-02-04T05:10:21","slug":"realistic-food-beverage-management-with-ox_inventory-in-fivem","status":"publish","type":"post","link":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/","title":{"rendered":"Realistic Food &#038; Beverage Management with ox_inventory in FiveM"},"content":{"rendered":"<p>Integrating a realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interactions. The <code>ox_inventory<\/code> system offers a flexible and efficient way to manage such items, allowing for detailed customization and seamless integration.<\/p>\n<p>To integrate a realistic food and drink system into your FiveM server using <code>ox_inventory<\/code>, follow these steps:<\/p>\n<p><strong>1. Setting Up <code>ox_inventory<\/code><\/strong><\/p>\n<ul>\n<li><strong>Installation<\/strong>:\n<ul>\n<li>Ensure the following dependencies are installed:\n<ul>\n<li><code>oxmysql<\/code><\/li>\n<li><code>ox_lib<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Download the latest release of <code>ox_inventory<\/code> from the <a href=\"https:\/\/github.com\/overextended\/ox_inventory\" target=\"_new\" rel=\"noopener\">official GitHub repository<\/a>.<\/li>\n<li>Add the resource to your server&#8217;s resource folder and include it in your <code>server.cfg<\/code>:\u00a0 ensure ox_inventory<\/li>\n<\/ul>\n<\/li>\n<li><strong>Configuration<\/strong>:\n<ul>\n<li>Configure the resource using convars in your <code>server.cfg<\/code>. For example:\u00a0 setr inventory:framework &#8220;esx&#8221; setr inventory:slots 50 setr inventory:weight 30000<\/li>\n<li>Detailed configuration options are available in the <a target=\"_new\" rel=\"noopener\">official documentation<\/a>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>2. Defining Food and Drink Items<\/strong><\/p>\n<p>To introduce consumable items like food and drinks, define them in the <code>data\/items.lua<\/code> file of the <code>ox_inventory<\/code> resource. Each item is represented by a unique key and a table of properties:<\/p>\n<pre><code>['burger'] = { label = 'Burger', weight = 220, stack = true, close = true, client = { status = { hunger = 200000 }, anim = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' }, prop = { model = 'prop_cs_burger_01', pos = { x = 0.02, y = 0.02, z = -0.02 }, rot = { x = 0.0, y = 0.0, z = 0.0 } }, usetime = 2500, } }, ['water'] = { label = 'Water Bottle', weight = 500, stack = true, close = true, client = { status = { thirst = 200000 }, anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' }, prop = { model = 'prop_ld_flow_bottle', pos = { x = 0.0, y = 0.0, z = -0.15 }, rot = { x = 0.0, y = 0.0, z = 0.0 } }, usetime = 2500, } } <\/code><\/pre>\n<p>In this configuration:<\/p>\n<ul>\n<li><strong>label<\/strong>: The display name of the item.<\/li>\n<li><strong>weight<\/strong>: The weight of the item in grams.<\/li>\n<li><strong>stack<\/strong>: Indicates if the item can be stacked.<\/li>\n<li><strong>close<\/strong>: Determines if the inventory closes upon item use.<\/li>\n<li><strong>client<\/strong>: Client-side properties:\n<ul>\n<li><strong>status<\/strong>: Adjusts player statuses like hunger or thirst upon consumption.<\/li>\n<li><strong>anim<\/strong>: Specifies the animation dictionary and clip to play during use.<\/li>\n<li><strong>prop<\/strong>: Defines the model and positioning of any props used during the animation.<\/li>\n<li><strong>usetime<\/strong>: Duration in milliseconds for using the item.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>For a comprehensive guide on creating items, refer to the <a href=\"https:\/\/overextended.dev\/ox_inventory\/Guides\/creatingItems\" target=\"_new\" rel=\"noopener\">official documentation<\/a>.<\/p>\n<p><strong>3. Making Items Usable<\/strong><\/p>\n<p>To enable players to use these items, especially if you&#8217;re using a framework like ESX, register the items as usable:<\/p>\n<pre><code>ESX.RegisterUsableItem('burger', function(playerId) TriggerClientEvent('ox_inventory:useItem', playerId, 'burger') end) ESX.RegisterUsableItem('water', function(playerId) TriggerClientEvent('ox_inventory:useItem', playerId, 'water') end) <\/code><\/pre>\n<p>This setup ensures that when a player uses a &#8216;burger&#8217; or &#8216;water&#8217; item, the appropriate effects and animations are triggered.<\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p>By integrating <code>ox_inventory<\/code> and defining consumable items with associated animations and effects, you can significantly enhance the realism and immersion of your FiveM server. This system provides a robust framework for managing player inventories, ensuring a seamless and engaging experience for all participants.<\/p>\n<p>For more detailed information, refer to the <a target=\"_new\" rel=\"noopener\">official <code>ox_inventory<\/code> documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Integrating a realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interactions. The <code>ox_inventory<\/code> system offers &#8230;<\/p>\n","protected":false},"author":1,"featured_media":141,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,2],"tags":[29,100,102,101,99],"class_list":["post-140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fivem","category-how-to-guides","tag-fivem","tag-food-managment","tag-hamburger","tag-ox_inventory","tag-realistic-food"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Realistic Food &amp; Beverage Management with ox_inventory in FiveM - 0Resmon<\/title>\n<meta name=\"description\" content=\"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Realistic Food &amp; Beverage Management with ox_inventory in FiveM - 0Resmon\" \/>\n<meta property=\"og:description\" content=\"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/\" \/>\n<meta property=\"og:site_name\" content=\"0Resmon\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-04T05:10:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"821\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"resmon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"resmon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/\",\"url\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/\",\"name\":\"Realistic Food & Beverage Management with ox_inventory in FiveM - 0Resmon\",\"isPartOf\":{\"@id\":\"https:\/\/0resmon.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png\",\"datePublished\":\"2025-02-04T05:10:21+00:00\",\"dateModified\":\"2025-02-04T05:10:21+00:00\",\"author\":{\"@id\":\"https:\/\/0resmon.com\/blog\/#\/schema\/person\/b5db0feca8abe40a98f1583db775964d\"},\"description\":\"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.\",\"breadcrumb\":{\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage\",\"url\":\"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png\",\"contentUrl\":\"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png\",\"width\":1200,\"height\":821,\"caption\":\"fivem foods\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/0resmon.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Realistic Food &#038; Beverage Management with ox_inventory in FiveM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/0resmon.com\/blog\/#website\",\"url\":\"https:\/\/0resmon.com\/blog\/\",\"name\":\"0Resmon\",\"description\":\"First FiveM and Redm Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/0resmon.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/0resmon.com\/blog\/#\/schema\/person\/b5db0feca8abe40a98f1583db775964d\",\"name\":\"resmon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/0resmon.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dd3af54fce7e5bd0d293479c24e746abcf619eecab7d498c190db714511d70c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dd3af54fce7e5bd0d293479c24e746abcf619eecab7d498c190db714511d70c?s=96&d=mm&r=g\",\"caption\":\"resmon\"},\"sameAs\":[\"https:\/\/0resmon.com\/blog\"],\"url\":\"https:\/\/0resmon.com\/blog\/author\/resmon\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Realistic Food & Beverage Management with ox_inventory in FiveM - 0Resmon","description":"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/","og_locale":"en_US","og_type":"article","og_title":"Realistic Food & Beverage Management with ox_inventory in FiveM - 0Resmon","og_description":"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.","og_url":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/","og_site_name":"0Resmon","article_published_time":"2025-02-04T05:10:21+00:00","og_image":[{"width":1200,"height":821,"url":"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png","type":"image\/png"}],"author":"resmon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"resmon","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/","url":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/","name":"Realistic Food & Beverage Management with ox_inventory in FiveM - 0Resmon","isPartOf":{"@id":"https:\/\/0resmon.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage"},"image":{"@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage"},"thumbnailUrl":"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png","datePublished":"2025-02-04T05:10:21+00:00","dateModified":"2025-02-04T05:10:21+00:00","author":{"@id":"https:\/\/0resmon.com\/blog\/#\/schema\/person\/b5db0feca8abe40a98f1583db775964d"},"description":"Realistic food and drink system into your FiveM server enhances the role-playing experience by adding depth to player interaction.","breadcrumb":{"@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#primaryimage","url":"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png","contentUrl":"https:\/\/0resmon.com\/blog\/wp-content\/uploads\/2025\/02\/downloadedImage-28.png","width":1200,"height":821,"caption":"fivem foods"},{"@type":"BreadcrumbList","@id":"https:\/\/0resmon.com\/blog\/realistic-food-beverage-management-with-ox_inventory-in-fivem\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/0resmon.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Realistic Food &#038; Beverage Management with ox_inventory in FiveM"}]},{"@type":"WebSite","@id":"https:\/\/0resmon.com\/blog\/#website","url":"https:\/\/0resmon.com\/blog\/","name":"0Resmon","description":"First FiveM and Redm Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/0resmon.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/0resmon.com\/blog\/#\/schema\/person\/b5db0feca8abe40a98f1583db775964d","name":"resmon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/0resmon.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3dd3af54fce7e5bd0d293479c24e746abcf619eecab7d498c190db714511d70c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dd3af54fce7e5bd0d293479c24e746abcf619eecab7d498c190db714511d70c?s=96&d=mm&r=g","caption":"resmon"},"sameAs":["https:\/\/0resmon.com\/blog"],"url":"https:\/\/0resmon.com\/blog\/author\/resmon\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":1,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/142"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/media\/141"}],"wp:attachment":[{"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0resmon.com\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}