Full View config.lua

Preview File Updated: v1.0.4 - 08.06.2023

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",
    ['menu_context.set_name_confirm'] = {icon = "", label = "Confirm"},
    ['set_description'] = "Set description of your marketplace",
    ['menu_context.set_description_confirm'] = {icon = "", label = "Confirm"},
    ['placing_market'] = "You're setting up the market.",

    ['reached_limit_of_marketplaces_on_map'] = 'The limit of marketplaces placed on the map has been reached.', -- Config.MarketplacesLimitOnMap
    ['reached_limit_of_yours_marketplaces'] = 'You have reached the limit of your marketplaces.', -- Config.MarketplacesLimitPerPlayer

    ['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.",
    ['menu_context.set_new_name_confirm'] = {icon = "", label = "Confirm"},
    
    ['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.",
    ['menu_context.set_new_description_confirm'] = {icon = "", label = "Confirm"},

    ['enter_count_of_item'] = "Enter count of item",
    ['qb.input.enter_count_of_item_submit'] = "Submit",
    ['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_context.put_item_confirm'] = {icon = "", label = "Confirm"},
    
    ['menu.title.pull_item'] = "Pull Items",
    ['menu.element.pull_item'] = "%s - [%sx]", -- format: ITEMNAME, COUNT
    ['menu_context.pull_item_confirm'] = {icon = "", label = "Confirm"},
    
    ['menu.title.set_price'] = "Set Items Price",
    ['menu.element.set_price'] = "%s - %s$", -- format: ITEMNAME, PRICE
    ['menu_context.set_price_confirm'] = {icon = "", label = "Confirm"},
    ['qb.input.enter_price_of_item_submit'] = "Submit",

    ['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
    
    ['charged_for_setting_marketplace'] = "Charged %s$ for setting up a marketplace.",
    ['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.",
    ['menu_context.buy'] = {icon = "", label = "Buy"},
    
    ['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.",
    ['menu_context.withdraw_cash_confirm'] = {icon = "", label = "Confirm"},
    ['qb.input.withdraw_cash_submit'] = "Submit",
    ['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",


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

    ['target.open_management'] = {icon = "fas fa-times-circle", label = "Open Management"},
    ['target.open_marketplace'] = {icon = "fas fa-times-circle", label = "Open Marketplace"},

    ['you_cannot_put_this_item'] = "You cannot put this item for sale."
}


------------------------ █▄ ▄█ ▄▀▄ █ █▄ █   ▄▀▀ ██▀ ▀█▀ ▀█▀ █ █▄ █ ▄▀  ▄▀▀ ------------------------
------------------------ █ ▀ █ █▀█ █ █ ▀█   ▄██ █▄▄  █   █  █ █ ▀█ ▀▄█ ▄██ ------------------------
-- /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.HologramScale = 0.35

Config.KeyToAccess = 38 -- E

Config.UseTarget = false
Config.TargetResource = 'qtarget'
Config.Target = function(data, option)
    --[[
        data = {
            coords = coords of first prop
            heading = heading of first prop
            id = id of marketplace
            prop = spawned prop id
        }
    ]]
    exports[Config.TargetResource]:AddEntityZone('marketplace-'..data.id, data.prop, {
        name = 'marketplace-'..data.id,
        debugPoly = false,
        useZ = true,
    }, {
        options = option,
        distance = Config.DistanceToAccess
    })
end


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.Menu = 'esx_menu_default' -- "esx_menu_default" / "esx_context" / "ox_lib" / "qb-menu"
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.MarketplacesLimitOnMap = 100 -- if you don't want to set a limit, set it to 0
Config.MarketplacesLimitPerPlayer = 15 -- if you don't want to set a limit, set it to 0

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.BlacklistedItems = { -- The player will not be able to put the item up for sale
    -- ['bread'] = 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
}

Last updated