PlexScripts

Advanced Economic System PlexScripts

Aug 16th, 2024 (edited)
1,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.99 KB | Gaming | 0 0
  1. Config = {}
  2. Config.Debug = false
  3. Config.Framework = "qb-core"  -- Specify your framework, e.g., ESX or qb-core
  4. Config.locales = "en"  -- Specify your language
  5. Config.Inventory = "Old-QbInventory"  -- Choose your inventory system: New-QbInventory, Old-QbInventory, OX-Inventory, or custom
  6. Config.MoneyType = "bank"  -- Specify whether the seller receives money as bank or cash (for ESX, specify 'cash' if required)
  7. Config.WaitTimeBeforePriceChange = 30  -- Wait time before price update in seconds (setting a low value can impact performance)
  8. Config.InvDictionary = "qb-inventory/html/images/"  -- Directory for your items folder
  9. Config.PicturesEnding  = ".png" -- Picture File Extensions: No changes to these are typically required.
  10. Config.URL = "nui://" --File Format for Online Items: Use webp format for items that are available online.
  11. Config.AdminMenueCommand = "ecoadmin"  -- Command for the Admin menu, uses the ace permission system ("Economi.AdminMenu")
  12. Config.OpenNui = "eco"  -- Command to open the overlay
  13. Config.UseTimerBeforeCanSellAgain = true  -- Enable a timer before players can sell again at a shop (time can be specified for each shop in the shop config)
  14. Config.BlackMoneyItem = "blackmoney" -- Your item if you want to use blackmoney as an item
  15. Config.SendMessageForPriceChanges = true --If you enable this, everyone on the server will receive a notification whenever the price of an item changes.
  16.  
  17. Config.Menu = "qb-menu"  -- Specify your menu system: qb-menu or ox-menu
  18. Config.InputMenu = "qb-input"  -- Specify your input menu: qb-input or ox-input
  19.  
  20. Config.UseMarker = false  -- Set to true to use markers instead of NPCs; also set Config.UseNPC to false
  21. Config.TextUI = "okok"  -- Choose your TextUI: okok, oxlib, qb-TextUI, or custom
  22. Config.DrawMarkerDistance = 50  -- Render distance for the marker
  23.  
  24. Config.UseNPC = true  -- Set to true to use NPCs with a target system; also set Config.UseMarker to false
  25. Config.NPCSpawnDistance = 50  -- Distance at which NPCs spawn for the player
  26. Config.UseTextUi = false  -- Set to true to use TextUI instead of a target system; also set Config.UseTarget to false
  27. Config.UseTarget = true  -- Set to true to use a target system
  28. Config.Targetsystem = "qb-target"  -- Specify your target system: qb-target or ox-target (contact support for other targetsystems)
  29.  
  30. ----Discord Webhook----
  31.  
  32. Config.ServerName = "Atombude" --Put here your name from the Bot
  33. Config.BotName = "PlexScripts"
  34. Config.IconURL = "https://i.imgur.com/PB4LO09.png"
  35. Config.Titel = "Economic System"
  36.  
  37. --Your Discordweblink need to be placed in server/discord_weebhook.lua
  38.  
  39. Config.items = {  -- Config from the items, add as many items as needed
  40.  
  41.     ["metalscrap"] = {  -- Name of the item
  42.         hash = "metalscrap",  -- Hash of the item, should match the name
  43.         label = "Metalscrap",  -- Label of the item
  44.         category = "Metals",  -- Category of the item (items with the same category will be grouped together)
  45.         blackmoney = true, --if you want to add BlackMoney as an item put this to true.
  46.         standardprice = 30,  -- Initial start price of the item
  47.         salesbeforepricechange = 30,  -- Number of items that must be sold before the price changes. For example, if player A sells 10, player B sells 15 (totaling 25), and player C sells 7, the price will change after reaching 30 sales. Each sale is saved in the database.
  48.         maxitemspersell = 95,  -- Maximum number of items that can be sold at once (Set to 0 for unlimited.)
  49.         maxincreaseprice = 100,  -- Maximum price the item can increase to
  50.         maxdecreaseprice = 5,  -- Minimum price the item can decrease to
  51.         increase = {  -- Items that will cause the price to increase after reaching the sales threshold
  52.             [1] = { item = "gold",   amount = 1 },
  53.             [2] = { item = "apple",  amount = 2 },
  54.             [3] = { item = "banana", amount = 3 },
  55.             -- Add as many items as needed (each item must be defined in Config.items)
  56.         },
  57.         decrease = {  -- Items that will cause the price to decrease after reaching the sales threshold
  58.             [1] = { item = "metalscrap",   amount = 1 },
  59.             [2] = { item = "copper", amount = 2 },
  60.             -- Add as many items as needed (each item must be defined in Config.items)
  61.         }
  62.     },
  63.     ["goldingot"] = {
  64.         hash = "goldingot",
  65.         label = "Goldingot",
  66.         category = "Metals",
  67.         blackmoney = false,
  68.         standardprice = 500,
  69.         salesbeforepricechange = 1,
  70.         maxitemspersell = 0,
  71.         maxincreaseprice = 5211,
  72.         maxdecreaseprice = 125,
  73.         increase = {
  74.             [1] = { item = "iron",       amount = 1 },
  75.             [2] = { item = "metalscrap", amount = 5 },
  76.         },
  77.         decrease = {
  78.             [1] = { item = "goldingot",   amount = 1 },
  79.         }
  80.     },
  81.  
  82.     ["apple"] = {
  83.         hash = "apple",
  84.         label = "Apple",
  85.         category = "Fruits",
  86.         blackmoney = false,
  87.         standardprice = 12,
  88.         salesbeforepricechange = 10,
  89.         maxitemspersell = 55,
  90.         maxincreaseprice = 90,
  91.         maxdecreaseprice = 0,
  92.         increase = {
  93.             [1] = { item = "banana",       amount = 4 },
  94.             [2] = { item = "ironingot", amount = 2 },
  95.         },
  96.         decrease = {
  97.             [1] = { item = "apple",   amount = 3 },
  98.             [2] = { item = "tinore", amount = 5 },
  99.             [3] = { item = "copperore",   amount = 4 },
  100.         }
  101.     },
  102.  
  103.    
  104.     ["banana"] = {
  105.         hash = "banana",
  106.         label = "banana",
  107.         category = "Fruits",
  108.         blackmoney = false,
  109.         standardprice = 10,
  110.         salesbeforepricechange = 150,
  111.         maxitemspersell = 12,
  112.         maxincreaseprice = 95,
  113.         maxdecreaseprice = 2,
  114.         increase = {
  115.             [1] = { item = "apple",       amount = 1 },
  116.             [2] = { item = "metalscrap", amount = 5 },
  117.         },
  118.         decrease = {
  119.             [1] = { item = "banana",   amount = 1 },
  120.             [2] = { item = "goldingot", amount = 2 },
  121.         }
  122.     },
  123.  
  124.     ["ironingot"] = {
  125.         hash = "ironingot",
  126.         label = "Ironingot",
  127.         category = "Metals",
  128.         blackmoney = false,
  129.         standardprice = 24,
  130.         salesbeforepricechange = 35,
  131.         maxitemspersell = 30,
  132.         maxincreaseprice = 247,
  133.         maxdecreaseprice = 6,
  134.         increase = {
  135.             [1] = { item = "copperore",       amount = 15 },
  136.             [2] = { item = "tinore", amount = 12 },
  137.             [3] = { item = "banana", amount = 8 },
  138.             [4] = { item = "goldingot", amount = 2 },
  139.         },
  140.         decrease = {
  141.             [1] = { item = "ironingot",   amount = 10 },
  142.             [2] = { item = "apple", amount = 4},
  143.  
  144.         }
  145.     },
  146.  
  147.     ["copperore"] = {
  148.         hash = "copper",
  149.         label = "Copperore",
  150.         category = "Ores",
  151.         blackmoney = false,
  152.         standardprice = 23,
  153.         salesbeforepricechange = 1,
  154.         maxitemspersell = 50,
  155.         maxincreaseprice = 125,
  156.         maxdecreaseprice = 10,
  157.         increase = {
  158.             [1] = { item = "apple",       amount = 1 },
  159.         },
  160.         decrease = {
  161.             [1] = { item = "copperore",   amount = 5 },
  162.         }
  163.     },
  164.  
  165.     ["tinore"] = {
  166.         hash = "tinore",
  167.         label = "Tinore",
  168.         category = "Ores",
  169.         blackmoney = false,
  170.         standardprice = 60,
  171.         salesbeforepricechange = 15,
  172.         maxitemspersell = 100,
  173.         maxincreaseprice = 985,
  174.         maxdecreaseprice = 15,
  175.         increase = {
  176.         },
  177.         decrease = {
  178.             [1] = { item = "tinore",   amount = 4 },
  179.         }
  180.     },
  181.  
  182.     --add as many as needed
  183. }
  184.  
  185. Config.SellPoints = {
  186.  
  187.     {
  188.         name = "Exporthändler", -- - Name of the shop, must be unique for every shop
  189.         currency = "bank", -- Specifies whether the seller receives money as bank or cash (for ESX, money will be added here if it should be cash)
  190.         TimerCanSellAgain = 30, --Cooldown duration before a player can sell again in seconds (requires Config.UseTimerBeforeCanSellAgain to be true)
  191.         coords = vector3(1087.72, 2690.96, 37.83), -- Blip and marker position  
  192.         radius = 1, -- Interaction radius for the markers
  193.         blip = { show = true, blipId = 38, blipColor = 2, blipScale = 0.6, blipText = "Exporthändler" }, -- Blip informations https://docs.fivem.net/docs/game-references/blips/      
  194.         marker = { id = 20, color = { r = 31, g = 94, b = 255, a = 90 }, size = { x = 0.5, y = 0.5, z = 0.5 }, bobUpAndDown = 0, faceCamera = 0, rotate = 1, drawOnEnts = 0 }, -- Marker information for the sellpoint https://docs.fivem.net/docs/game-references/markers/
  195.         items = "tinore,copperore", --  Types of items that can be sold here; put the names of items to be displayed in the menu (must be defined in Config.items)
  196.         MenueHeader = "Exporthändler", -- Title for the menu
  197.         text = "Exportändler öffnen", -- Text for the target or if you use TextUI for the text UI
  198.         NPCPosition = vector4(1087.72, 2690.96, 37.83, 257.46), -- Coordinates for NPC position (only needed if using NPCs to sell)
  199.         PedModel = "a_f_o_soucent_02", -- NPC model (if using NPCs) https://docs.fivem.net/docs/game-references/ped-models/
  200.     },
  201.  
  202.  
  203.     {
  204.         name = "fruitbuyer",
  205.         currency = "bank",
  206.         TimerCanSellAgain = 30,
  207.         coords = vector3(1189.04, 2683.07, 36.86),    
  208.         radius = 1,
  209.         blip = { show = false, blipId = 39, blipColor = 2, blipScale = 0.6, blipText = "Fruitsellpoint" },  
  210.         marker = { id = 20, color = { r = 31, g = 94, b = 255, a = 90 }, size = { x = 0.5, y = 0.5, z = 0.5 }, bobUpAndDown = 0, faceCamera = 0, rotate = 1, drawOnEnts = 0 },
  211.         items = "apple,banana",
  212.         MenueHeader = "Fruitdealer",
  213.         text = "open fruitdealer",
  214.         NPCPosition = vector4(1189.04, 2683.07, 36.86, 91.89),
  215.         PedModel = "a_f_m_bevhills_02",
  216.     },
  217.  
  218.      --add as many as needed
  219.  
  220. }
  221.  
  222.  
  223.  
  224.  
  225. --[[ These sellpoints function similarly to the ones below, but they do not affect the economy's items and are not displayed in the NUI.
  226.      Use these for simple sellpoints for less important items.
  227. ]]
  228.  
  229.  
  230. Config.SimpleSellPoints = {
  231.  
  232.  
  233.     {
  234.         name = "pawnshop",
  235.         currency = "cash",
  236.         TimerCanSellAgain = 60,
  237.         coords = vector3(1189.04, 2683.07, 37.86),    
  238.         radius = 1,
  239.         blip = { show = true, blipId = 605, blipColor = 2, blipScale = 0.6, blipText = "Pawnshop" },   
  240.         marker = { id = 20, color = { r = 31, g = 94, b = 255, a = 90 }, size = { x = 0.5, y = 0.5, z = 0.5 }, bobUpAndDown = 0, faceCamera = 0, rotate = 1, drawOnEnts = 0 },
  241.         items = {
  242.             { item = "phone", label = "Phone", sellprice = 750, maxitemspersell = 15 },
  243.             { item = "radio", label = "Radio", sellprice = 25, maxitemspersell = 100},
  244.             { item = "wheel", label = "Wheel", sellprice = 10, maxitemspersell = 25},
  245.             -- Add as many items as needed
  246.         },
  247.         MenueHeader = "Pawnshop",
  248.         text = "open Pawnshop",
  249.         NPCPosition = vector4(1085.96, 2237.98, 44.85, 281.2),
  250.         PedModel = "a_f_m_bevhills_02",
  251.     },
  252.  
  253. }
Advertisement
Add Comment
Please, Sign In to add comment