[ESX] & [QBCORE] Market Stand Script | Advanced System

Showcase
MARKET STAND SCRIPT

Purchase
[QBCore & ESX] - Market stand script

Features

  • Dynamic Player-Driven Economy: Players create and manage their own market stands, selling a variety of items in designated zones or anywhere if zones are disabled.
  • Flexible Selling Zones: Server owners can configure specific selling zones or allow market stands to be placed anywhere on the map.
  • Staff Management: Hire staff with specific working hours, ensuring your stand is open and operational during peak times.
  • Rent System: Maintain active table stands by adding rent days. If rent expires, the stand will be removed.
  • Ownership Transfer: Easily transfer table ownership to other players, setting your own price for the transaction.
  • Penalty Enforcement: Police can issue penalties for illegal items found on your table. Configurable in the settings, these penalties must be paid before selling can resume.
  • Fully Customizable: Every aspect of the script can be customized via a config file, making it adaptable to various RP scenarios and server rules.
  • Optimized Performance: Fully optimized script ensuring smooth gameplay and performance with no significant hit to server resources.
  • Protection Against Exploits: Advanced measures have been implemented to prevent script exploitation.

Optimization
Full optimized.
0.00 ms

Code is accessible No
Subscription-based No
Lines (approximately) : ~3400
Requirements d3MBA-lib - Support most popular context menus (ox_lib, qb-menu, nh-context) - (ox_target, qtarget, qb-target)
Support Yes

Other Resources

Config

Config.DebugPolyZone = false -- [true/false] - If you want to see polyzone borders, set it to 'true' (Config.DebugPolyZone = true) 

Config.KickReason = "[d3MBA-marketstand] | Protection!" -- Kick reason if player try to cheat.

Config.BlacklistZonesDebug = false -- true/flase | Default: false | If you set this to true, you will see the Blacklist Zones in the game (marker).
Config.BlacklistZones = { -- Blacklist zones where player can't do actions. 
    {coords = vector3(453.1656, -985.860, 30.689), radius = 70.0}, -- MRPD 
    {coords = vector3(332.6394, -582.348, 43.224), radius = 70.0}, -- Pillbox Hospital 
    -- Add more zones as needed
}

Config.SellingZones = { -- Selling zones where player can place table and sell items.
    Use = true, -- [true/false] - Set this to false if you want to disable the selling zones. Default: true

    Zones = {
        {coords = vector3(-296.24, 6123.03, 31.51), heading = 44, lenght = 29.2, width = 55.6, blip = true, name = "Paleto markets stand"}, -- Add more zones as needed 
        {coords = vector3(1013.07, -2329.94, 30.51), heading = 355, lenght = 82.05, width = 29.4, blip = true, name = "Los santos markets stand"}, -- Add more zones as needed 
    },

    Blip = { -- https://docs.fivem.net/docs/game-references/blips/
        Sprite = 478, -- Blip sprite
        Color = 2, -- Blip color
        Scale = 0.9, -- Blip scale 
    }
}

Config.PlacingTableTime = 1 -- Time in seconds to place table. 
Config.RemoveTableTime = 5 -- Time in seconds to remove table. 
Config.WritingPenaltyTime = 8 -- Time in seconds to write penalty.

Config.ShopPed = {
    Use = true, -- [true/false] - Set this to false if you want to disable the shop.

    Account = "cash", -- (bank / cash) | Default: cash | If you set this to bank, you will pay from bank account.

    Peds = { -- Pos = position of shop ped. 
        {Model = "a_m_m_socenlat_01", Pos = vector4(-267.738, 6141.551, 30.530, 133.26), Blip = true}, 
        {Model = "a_m_m_socenlat_01", Pos = vector4(1010.343, -2288.45, 29.509, 174.24), Blip = true}, 
    },

    TimeCheck = { 
        Use = false, -- (true/false) | Default: true | If you set this to false, shop will be open 24/7. 
        CheckTime = 3, -- Every 3 sec scitpt will check in game time. 
        OpeningTime = 8, -- Shop opening time = 8:00 AM.
        ClosingTime = 22, -- Shop close time = 10:00 PM.
    },  

    Blip = { -- https://docs.fivem.net/docs/game-references/blips/
        Sprite = 84, -- Blip sprite.
        Scale = 0.8, -- Blip scale.
        Color = 7, -- Blip color.
        Label = "[Market stand] - Shop",
    },

    OpenShopAfterBuy = false, -- [true/false] If true, script will open shop menu again after player bought something

    Items = {
        -- ItemName = name of item, Price = price of item
        {ItemName = "small_plastic_table", Price = 250},  
        {ItemName = "plastic_table", Price = 500},  
        {ItemName = "small_wooden_table", Price = 1200},  
        {ItemName = "wooden_table", Price = 2000},  
        {ItemName = "aluminum_table", Price = 3500},  
  
    }
}

Config.PricePerDay = 100 -- Charge for placing table per day. 
Config.Account = "cash" -- (bank / cash) | Default: cash | If you set this to bank, you will pay from bank account. 

Config.Tables = { 
    -- Weight = weight that table can hold (in grams) | Model = model of table

    ["small_plastic_table"] = {Weight = 10000, Model = "prop_table_03b"}, 
    ["plastic_table"] = {Weight = 15000, Model = "prop_table_03"}, 
    ["small_wooden_table"] = {Weight = 20000, Model = "prop_rub_table_01"}, 
    ["wooden_table"] = {Weight = 25000, Model = "prop_rub_table_02"}, 
    ["aluminum_table"] = {Weight = 35000, Model = "h4_prop_h4_table_isl_01a"}, 
    -- You can add more tables as needed. (Just use same format as below)
    -- Find table objects (prop) here https://forge.plebmasters.de/objects?search=table
}


Config.PersonsToHire = { -- You can add more persons to hire. (Just use same format as below)
    {Name = "John", Model = "a_m_m_salton_02", WorkingTime = {From = 09, To = 17}, Salary = 125}, 
    {Name = "Michael", Model = "a_m_m_rurmeth_01", WorkingTime = {From = 10, To = 18}, Salary = 145},
    {Name = "Frank", Model = "a_m_m_salton_03", WorkingTime = {From = 11, To = 19}, Salary = 165},
    {Name = "Tom", Model = "a_m_m_skidrow_01", WorkingTime = {From = 12, To = 20}, Salary = 185},
    {Name = "Jack", Model = "a_m_m_socenlat_01", WorkingTime = {From = 13, To = 21}, Salary = 190},
    {Name = "Robert", Model = "a_m_m_soucent_02", WorkingTime = {From = 14, To = 22}, Salary = 200},
    {Name = "James", Model = "a_m_m_stlat_02", WorkingTime = {From = 15, To = 23}, Salary = 210},
    {Name = "William", Model = "a_m_y_genstreet_02", WorkingTime = {From = 16, To = 24}, Salary = 220},
    {Name = "David", Model = "a_m_y_indian_01", WorkingTime = {From = 17, To = 01}, Salary = 225},
    {Name = "Richard", Model = "csb_hugh", WorkingTime = {From = 18, To = 02}, Salary = 230},
    {Name = "Joseph", Model = "ig_djsolfotios", WorkingTime = {From = 19, To = 03}, Salary = 235},
    {Name = "Thomas", Model = "ig_djblamrupert", WorkingTime = {From = 20, To = 04}, Salary = 240},
    {Name = "Charles", Model = "ig_g", WorkingTime = {From = 21, To = 05}, Salary = 245},
    {Name = "Christopher", Model = "ig_hao", WorkingTime = {From = 22, To = 06}, Salary = 250},
    {Name = "Daniel", Model = "ig_joeminuteman", WorkingTime = {From = 23, To = 07}, Salary = 260},
    {Name = "Matthew", Model = "ig_lamardavis", WorkingTime = {From = 00, To = 08}, Salary = 270},
    {Name = "Anthony", Model = "ig_lestercrest", WorkingTime = {From = 01, To = 09}, Salary = 300}
}
Config.RefundPercentage = 50 -- Percentage of the remaining days' salary to be refunded when firing a person.

Config.Penalty = {  
    Amount = { -- Min = minimum penalty, Max = maximum penalty per illegal item. e.g if player has 2 illegal different illegal items on the table, 
                            -- player with the police job will be able to add penalty from 1000 to 3000 depending on the amount of illegal items.                                     
        Min = 500, 
        Max = 1500, 
    }, 

    Jobs = { -- List of the jobs that can add penalty to the table owner.
        -- You can add more jobs as needed. (Just use same format as below (job name))
        "police", 
    }
}

Config.Rotation = {    
    -- Here you can find key codes: https://docs.fivem.net/docs/game-references/controls/
    RotationCounterClockwise = 189, -- 189 = "ARROW LEFT" key
    RotationClockwise = 190, -- 190 = "ARROW RIGHT" key

    Submit = 38, -- 38 = "E" key
    Cancel = 47, -- 47 = "G" key
    
    Text3D = { -- Position of 3D text that will be displayed when you rotate the object. 
        x = 0.365, -- x = 0.365 | 0.365 = center of the screen | 0.0 = left side of the screen | 1.0 = right side of the screen  
        y = 0.95 -- y = 0.95 | 0.95 = bottom of the screen | 0.0 = top of the screen | 1.0 = bottom of the screen 
    },
}


-- Function to draw the text. (Placing table instructions) - (This will be in the loop so it will update the text every frame (wait 0ms))
function Draw2DText(text)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextScale(0.6, 0.6)
    SetTextColour(255, 255, 255, 255)
    SetTextDropShadow(0, 0, 0, 0, 255)
    SetTextEdge(1, 0, 0, 0, 255)
    SetTextDropShadow()
    SetTextOutline()

    BeginTextCommandDisplayText('STRING')
    AddTextComponentSubstringPlayerName(text)
    EndTextCommandDisplayText(Config.Rotation.Text3D.x, Config.Rotation.Text3D.y)  -- Adjust these values as needed
end




Config.BlacklistedItems = { -- List of the items that cannot be added to the table stand.
    "cash",
    "money",
    "black_money",
    "bank",
    -- Add more items as needed ("item_name")
}





Config.IllegalItems = { -- List of the illegal items for those items owner of the table stand can be penalized.
    -- Add more items as needed ("item_name")
    "replace_with_item_name",
}
2 Likes