[ESX/QB] vms_marketplaces | Stalls owned by players

ezgif.com-optimize (2)

:money_with_wings: BUY IT HERE: www.vames-store.com

Types of marketplaces:

types

Management menu of marketplace:

mp_manager

Purchase menu as a customer:

mp_client

Webhook Logs:


β€’ Compatible with ESX & QB-Core
β€’ Compatible with Target system
β€’ For ESX Requirement is esx_menu_default & esx_menu_dialog or esx_context
β€’ For QB Requirement is qb-menu & qb-input
β€’ Ability to sell offline - when the player is not on the server, other players can continue shopping in his marketplace
β€’ You can set from what distance the hologram will be visible
β€’ You can set from what distance it will be possible to interact with the marketplace
β€’ You can change the interaction key with the marketplace
β€’ You can change the size of the inscription in the hologram
β€’ You can set a custom time and animation of placing marketplace
β€’ You can set a custom time and animation of removing marketplace
β€’ You can set a custom price for changing the name/description of a marketplace
β€’ You can set the amount a player must pay to set up his own marketplace
β€’ You can set a minimum distance between marketplaces so that no one stalls on another stall
β€’ You can set the discount values from which the player can choose for his marketplace
β€’ You can disable or enable each stall management option in the config (for example, if you don’t want players to be able to change the name you can disable it).
β€’ You can add new marketplace prop sets by adding to config
β€’ You can enable the UseMarketsZones option - it makes it possible to set up a stall only in the areas you designate, to each area you can set the size and price for setting up a stall there
β€’ When adding stall areas, you can run the Config.DebugMarketsZones option which will continuously show the ocoorded stall area
β€’ There is a command for the administrator with which he can check the owner and ID of the marketplace and can delete the marketplace
β€’ Stall icons for items have been included
β€’ All useful information for the administrator has been adden in the webhook, you can manage the logs in config.server.lua
β€’ Fully translatable script in config
β€’ Full support

Marketplace Management Panel:

– Change Name | Ability to change the name of marketplace
– Change Description | Ability to change the description of marketplace
– Withdraw Cash | Stall account balance, withdrawal (this is where the money from sold items comes in)
– Put Items | Putting items for sale
– Get Items | Pulling items from sale
– Set Prices | Setting prices of items for sale
– Enable Discount | Ability to run discounts on the stall (in the config you can set what possibilities of discount values to have)
– Client View | View from the customer’s perspective
– Close/Open Market | Stall close/open - when a stall is closed no one can buy anything from it and only then can the owner put/pull items, set prices, set promotions
– Remove Market | Possibility of removing the stall

Config = {}

------------------------------ β–ˆβ–€ β–ˆβ–€β–„ β–„β–€β–„ β–ˆβ–„ β–„β–ˆ β–ˆβ–ˆβ–€ β–ˆ   β–ˆ β–„β–€β–„ β–ˆβ–€β–„ β–ˆβ–„β–€ ------------------------------
------------------------------ β–ˆβ–€ β–ˆβ–€β–„ β–ˆβ–€β–ˆ β–ˆ β–€ β–ˆ β–ˆβ–„β–„ β–€β–„β–€β–„β–€ β–€β–„β–€ β–ˆβ–€β–„ β–ˆ β–ˆ ------------------------------
Config.Core = "ESX" -- "ESX" / "QB-Core"
Config.CoreExport = function()
    return exports['es_extended']:getSharedObject()
    -- return exports['qb-core']:GetCoreObject()
end

Config.Notification = function(message, time, type)
    if type == "success" then
        exports['vms_notify']:Notification("MARKETPLACE", message, time, "#36f230", "fa-solid fa-store")
        -- ESX.ShowNotification(message)
		-- QBCore.Functions.Notify(message, "success", time)
    elseif type == "error" then
        exports['vms_notify']:Notification("MARKETPLACE", message, time, "#f23030", "fa-solid fa-store")
        -- ESX.ShowNotification(message)
		-- QBCore.Functions.Notify(message, "error", time)
    elseif type == "info" then
        exports['vms_notify']:Notification("MARKETPLACE", message, time, "#4287f5", "fa-solid fa-store")
        -- ESX.ShowNotification(message)
		-- QBCore.Functions.Notify(message, "primary", time)
    end
end


------------------------------- β–€β–ˆβ–€ β–ˆβ–€β–„ β–„β–€β–„ β–ˆβ–„ β–ˆ β–„β–€β–€ β–ˆ   β–„β–€β–„ β–€β–ˆβ–€ β–ˆβ–ˆβ–€ -------------------------------
-------------------------------  β–ˆ  β–ˆβ–€β–„ β–ˆβ–€β–ˆ β–ˆ β–€β–ˆ β–„β–ˆβ–ˆ β–ˆβ–„β–„ β–ˆβ–€β–ˆ  β–ˆ  β–ˆβ–„β–„ -------------------------------
Config.Translate = {
    ['set_name'] = "Set name of your marketplace",
    ['set_description'] = "Set description of your marketplace",
    ['placing_market'] = "You're setting up the market.",

    ['you_set_up_market'] = "You have set up your market, now give the name and description of your stall.",
    ['cannot_set_up_market_here'] = "You cannot set up your market in this place.",

    ['you_set_up_infos'] = "You have set up your market name and description",

    ['menu.your_market'] = "Your Market",
    ['menu.change_name'] = {icon = "fas fa-keyboard", label = "Change Name", hint = ""},
    ['menu.change_description'] = {icon = "fas fa-keyboard", label = "Change Description", hint = ""},
    ['menu.withdraw_cash'] = {icon = "fas fa-file-invoice-dollar", label = "Withdraw Cash - <span style='color:lightgreen'>%s$</span>", hint = ""},
    ['menu.put_items'] = {icon = "fas fa-hands", label = "Put Items", hint = ""},
    ['menu.pull_items'] = {icon = "fas fa-hand-rock", label = "Pull Items", hint = ""},
    ['menu.set_prices'] = {icon = "fas fa-tags", label = "Set Prices", hint = ""},
    ['menu.enable_discount'] = {icon = "fal fa-badge-percent", label = "Enable Discount", hint = ""},
    ['menu.client_preview'] = {icon = "fas fa-eye", label = "Client View", hint = ""},
    ['menu.manage_market'] = {icon = "fas fa-lock", label = "Close/Open Market", hint = ""},
    ['menu.remove_market'] = {icon = "fas fa-times-circle", label = "Remove Market", hint = ""},
    
    ['set_new_name'] = "Change name for %s$", -- format: PRICE
    ['you_set_up_new_name'] = "You're setting up new name '%s' for %s$", -- format: NEWNAME, PRICE
    ['name_is_too_long'] = "The maximum length of the name is %s", -- format: Config.MaxLengthName
    ['name_must_fill'] = "You must to fill the name.",
    
    ['set_new_description'] = "Change description for %s$", -- format: PRICE
    ['you_set_up_new_description'] = "You're setting up new description '%s' for %s$", -- format: NEWDESCRIPTION, PRICE
    ['description_is_too_long'] = "The maximum length of the description is %s", -- format: Config.MaxLengthDescription
    ['description_must_fill'] = "You must to fill the description.",

    ['enter_count_of_item'] = "Enter count of item",
    ['enter_price_of_item'] = "Enter new price for %s", -- format: ITEMNAME

    ['menu.title.put_item'] = "Select Item",
    ['menu.element.put_item'] = "%s - %sx", -- format: ITEMNAME, COUNT
    
    ['menu.title.pull_item'] = "Pull Items",
    ['menu.element.pull_item'] = "%s - [%sx]", -- format: ITEMNAME, COUNT
    
    ['menu.title.set_price'] = "Set Items Price",
    ['menu.element.set_price'] = "%s - %s$", -- format: ITEMNAME, PRICE

    ['menu.title.set_discount'] = "Set Discount",
    ['menu.element.disable_discount'] = "Disable Discount",
    ['menu.element.set_discount'] = "Set Discount - %s", -- format: DISCOUNT%

    ['menu.title.remove_market'] = "Are you sure about remove %s market?",
    ['menu.element.remove_no'] = {icon = "fal fa-times", label = "No", hint = "Removing the marketplace will also remove the items and money that are currently in the marketplace!"}, -- if you are using ESX Menus by VMS, the player will have a menu hint telling you about it
    ['menu.element.remove_yes'] = {icon = "fas fa-check", label = "Yes", hint = "Removing the marketplace will also remove the items and money that are currently in the marketplace!"}, -- if you are using ESX Menus by VMS, the player will have a menu hint telling you about it
    
    ['dont_have_money_for_place'] = "You don't have enough money to set up a marketplace.",

    ['menu.title.market'] = "Market - %s", -- format: MARKETNAME
    ['menu.element.market'] = "%s - [%sx] <span style='color:lightgreen'>%s$</span>", -- format: ITEMNAME, COUNT, PRICE
    ['menu.element.market_discounted'] = "%s - [%sx] <span style='color:lightgreen'>%s$</span> <span style='color:#c41d20cb; text-decoration: line-through;'>%s$</span>", -- format: ITEMNAME, COUNT, NEWPRICE, OLDPRICE
    
    ['3dtext.market'] = "%s<br><br>%s~g~%s~s~<br>%s", -- format: LOCKED, DISCOUNT, MARKETNAME, MARKETDESCRIPTION
    ['3dtext.discount'] = "~y~Discount: %s~s~<br>", -- format: DISCOUNT
    ['3dtext.closed'] = "~r~CLOSED~s~",
    ['3dtext.opened'] = "~g~OPEN~s~",
    
    ['you_dont_have_items'] = "You don't have any items in inventory.",
    ['your_market_dont_have_items'] = "Your market don't have any items for sell.",
    ['this_market_dont_have_items'] = "This market don't have any items for sell",
    ['this_market_is_closed'] = "This market is currently CLOSED.",
    
    ['you_have_bought_item'] = "You purchased %s %sx for %s$", -- format: ITEMNAME, COUNT, PRICE
    ['you_have_pull_item'] = "You have taken out an %s %sx", -- format: ITEMNAME, COUNT
    ['you_put_item'] = "You have placed %s %sx in your marker", -- format: ITEMNAME, COUNT
    ['shop_dont_have_enough_items'] = "This shop don't have that many items.",
    ['dont_have_enough_items'] = "You don't have that many items.",
    
    ['you_set_new_price_item'] = "You set a new price for the item %s - %s$", -- format: ITEMNAME, PRICE
    
    ['dont_have_enough_money'] = "You don't have enough money for this.",

    ['you_closed_market'] = "You closed market.",
    ['you_opened_market'] = "You opened market.",
    
    ['withdraw_cash'] = "Enter how much you want to withdraw.",
    ['you_withdraw'] = "You withdraw %s$ from your market.",
    ['market_dont_have_enough_money'] = "Your market don't have enough money for withdraw.",
    ['withdraw_by_number'] = "Enter how much you want to withdraw as a number.",

    ['too_close_marketplace'] = "You can't place that close to your marketplace next to another one.",
    
    ['you_enabled_discount'] = "You enabled %s discount.",
    ['you_disabled_discount'] = "You disabled discount.",    

    ['you_must_close_before_action'] = "You must close the marketplace before this action.",    
    ['this_marketplace_has_been_closed'] = "This marketplace has been closed, you did not have time to buy the product.",    

    ['qb.input.infos_header'] = "Fill the informations of your marketplace",
    ['qb.input.infos_name'] = "Set name of your marketplace",
    ['qb.input.infos_description'] = "Set description of your marketplace",
    ['qb.input.infos_submit'] = "Submit",
    
    ['qb.input.change_name'] = "Set name of your marketplace",
    ['qb.input.change_name_submit'] = "Submit",

    ['qb.input.description_name'] = "Set description of your marketplace",
    ['qb.input.change_description_submit'] = "Submit",

    ['qb.input.withdraw_cash_submit'] = "Submit",

    ['qb.input.enter_count_of_item_submit'] = "Submit",

    ['qb.input.enter_price_of_item_submit'] = "Submit",

    ['admincmd.who_is_owner'] = "The owner of marketplace ID: %s is %s." -- format: ID, OWNER
}


------------------------ β–ˆβ–„ β–„β–ˆ β–„β–€β–„ β–ˆ β–ˆβ–„ β–ˆ   β–„β–€β–€ β–ˆβ–ˆβ–€ β–€β–ˆβ–€ β–€β–ˆβ–€ β–ˆ β–ˆβ–„ β–ˆ β–„β–€  β–„β–€β–€ ------------------------
------------------------ β–ˆ β–€ β–ˆ β–ˆβ–€β–ˆ β–ˆ β–ˆ β–€β–ˆ   β–„β–ˆβ–ˆ β–ˆβ–„β–„  β–ˆ   β–ˆ  β–ˆ β–ˆ β–€β–ˆ β–€β–„β–ˆ β–„β–ˆβ–ˆ ------------------------
-- /marketplace remove
-- /marketplace getowner
Config.AdminCommand = { -- By typing this command, it works for the nearest marketplace
    Enabled = true,
    Group = "admin",
    Name = "marketplace",
    Help = "Manage the player's marketplace",
    Arg1 = "remove",
    Arg2 = "getowner",
    ArgHelp = "remove/getowner",
    Distance = 2.5 -- it works on the nearest marketplace at a distance of 2.5m
}

Config.DistanceToSeeHologram = 4.5
Config.DistanceToAccess = 2.15
Config.KeyToAccess = 38 -- E

Config.HologramScale = 0.35

Config.TimeOfPlacingMarket = 5000 -- Duration of marketplace placement, after this time a menu will be launched to fill in the name and description of the marketplace
Config.PlacingMarketAnim = {
    animDict = "amb@prop_human_bum_bin@idle_b",
    animName = "idle_d",
    duration = -1,
    flag = 1,
}

Config.TimeOfRemovingMarket = 4000 -- Duration of marketplace removal, after this time the menu whether you are sure you want to remove the marketplace will run
Config.RemovingMarketAnim = {
    animDict = "amb@prop_human_bum_bin@idle_b",
    animName = "idle_d",
    duration = -1,
    flag = 1,
}

Config.ManageMenuAlign = 'right' -- Only for ESX Menus
Config.MarketMenuAlign = 'right' -- Only for ESX Menus

Config.MaxLengthName = 50
Config.MaxLengthDescription = 120

Config.ChangeNamePrice = 5000
Config.ChangeDescriptionPrice = 7500

Config.MinimumDistanceBetweenMarketplaces = 5.0

Config.PriceForPlace = 5000 -- You can set a price for laying out your own marketplace, if you don't want to, set 0     !!! If YOU USE Config.MarketsZones, IT WON'T WORK !!!

Config.DBTimeoutSaveLockedStatus = 10 * 60 * 1000 -- 10 minutes

Config.MarketplacesDiscounts = {10, 20, 30} -- Available discounts to be launched by marketplace owners

Config.MarketplaceManageOptions = { -- Here you can disable some options in marketplace management
    ['change_name'] = true,
    ['change_description'] = true,
    ['withdraw_cash'] = true,
    ['put_items'] = true,
    ['pull_items'] = true,
    ['set_prices'] = true,
    ['enable_discount'] = true,
    ['client_preview'] = true,
    ['manage_market'] = true,
    ['remove_market'] = true,
}

Config.MarketplacesOnItem = true
Config.ReturnItemAfterRemoveMarketplace = true
Config.MarketplaceItems = { -- This is used in config.server.lua
    ['normal'] = {item = 'marketplace_normal'},
    ['big'] = {item = 'marketplace_big'},
    ['hotdog'] = {item = 'marketplace_hotdog'},
    ['burgers'] = {item = 'marketplace_burgers'},
}

Config.MarketplaceSets = {
    ['normal'] = {
        [468818960] = {x = 0.0, y = 1.5, z = -1.0, h = 180.0}, -- Umbrella
        [386059801] = {x = 0.0, y = 0.95, z = -1.0, h = 180.0}, -- Table
        [-741944541] = {x = 0.0, y = 2.3, z = -1.0, h = 0.0}, -- Plastic Chair
    },
    ['big'] = {
        [858993389] = {x = 0, y = 2.95, z = -1.1, h = 0.0}, -- Fruit Marketplace
    },
    ['hotdog'] = {
        [-1581502570] = {x = 0, y = 2.35, z = -1.1, h = 0.0}, -- Hot Dog
    },
    ['burgers'] = {
        [1129053052] = {x = 0, y = 1.75, z = -1.0, h = 0.0}, -- Burgers
    },
}

Config.UseMarketsZones = false -- if you want to designate the area in which players can make their stall, set true, if you want them to be able to set up in any place set false.
Config.DebugMarketsZones = false -- Only for testing if you coording Config.MarketsZones so you know what areas are taken into account.
Config.MarketsZones = {
    {coords = vector3(-1349.21, -1434.32, 3.32), radius = 100.0, priceForPlace = 2000}, -- Los Santos Plaza
    {coords = vector3(-1244.37, -1577.73, 3.09), radius = 100.0, priceForPlace = 8000}, -- Los Santos Plaza
    {coords = vector3(-1162.33, -1690.46, 3.37), radius = 80.0, priceForPlace = 20000}, -- Los Santos Plaza
}


β€” While not using:
not_use

β€” While using and hologram is on screen:
use

if you like this resource, buy now at a discounted price of -20% on the :blossom: SPRING SALE

Code is accessible Yes & No
Subscription-based No
Lines (approximately) Lua +1800
Requirements ESX / QB-Core
Support Yes
11 Likes

ox_target interaction?
qs-inventory interaction?
Overall really nice script as allways vames. <3

1 Like

Hi, for ox_target currently there is no option but I will try to add it, as for qs-inventory I think it should work if you have any problem write me and I will be happy to update it for compatibility.
Thank you so much :hugs:

2 Likes

Perfect :star_struck:

2 Likes

Thank you :man_technologist: :pray:

please update to utilize ox target & ox lib :smiley:

Looks really good! What is that for a menu you are using for the management panel? Custom made? I would like to buy that :smiley:

1 Like

nice work

1 Like

Please make sure to include the paid releases template.

1 Like

ok, I will check how OX stuff works and try to do it

These are ESX Menus only that redesigned by me and made available for free, you don’t have to buy :smile:
https://forum.cfx.re/t/esx-menus-redesigned-more-features

Thank you :hugs:

You are right, I completely forgot about it, thank you for the information. I have already added :saluting_face:

There are some issues. When the player logs back on after offline, the marketplaces not display

When the script receives ESX/QB PlayerData, it will be able to perform the loading of marketplaces.

[script:vms_marketpla] SCRIPT ERROR: @vms_marketplaces/server/server.lua:102: attempt to index a nil value (local β€˜xPlayer’)
[script:vms_marketpla] > TriggerCallback (@qb-core/server/functions.lua:298)
[script:vms_marketpla] > handler (@qb-core/server/events.lua:146)

Efficient and successfully solved the problem

1 Like

please update to utilize qtarget & ox lib :smiley:
[/quote]

that’s right, we fixed that problem.

:computer: UPDATE 1.0.0

[/] Fixed problem for QB-Core with loading marketplaces after rejoining server

Yes I know, I will try to add interaction with the target in the next update.