Config
Infinite.Config = {
UseTargetSystem = true, -- Use the target system for the rental locations.
Target = 'qb-target', -- Target system to use (qb-target, qtarget, ox_target)
InventoryImageURL = 'nui://qb-inventory/html/images/', -- The resources URL to resolve the image for the item(s).
PromptOpenEvent = function(text, key) -- If we dont use the target system, we use this event to show the prompt.
exports['qb-core']:DrawText('[' .. key .. '] ' .. text, 'left')
end,
PromptCloseEvent = function() -- If we dont use the target system, we use this event to hide the prompt.
exports['qb-core']:HideText()
end,
NotificationEvent = function(src, message, type) -- Notification event to send a notification to the player.
TriggerClientEvent('QBCore:Notify', src, message, type) -- Trigger the notification event.
end,
GiveItem = function(src, item, amount, metaData) -- Your method of giving the item to the player (called from server-side.)
-- ox_inventory:
--[[
exports['ox_inventory']:AddItem(src, item, amount, metaData)
]]
-- qb-inventory:
exports['qb-inventory']:AddItem(src, item, amount, false, metaData or false, 'infinite-shops:PurchaseItem') -- Add the item to the player inventory.
Infinite.Config.NotificationEvent(src, 'The purchase has been made successfully!', 'success') -- Send a notification to the player.
end,
Shops = { -- List of shops with their types, making things modular and reduces duplicate code for several locations.
["store"] = { -- Store type shop.
ShopName = 'General Store', -- Name of the shop.
ShopDescription = 'Has a variety of general items for sale, including food, drinks, and more.', -- Description of the shop.
items = { -- List of items,
{
item = 'tosti', -- Item ID.
price = 10 -- Price of the item.
},
{
item = 'coffee', -- Item ID.
price = 5 -- Price of the item.
},
{
item = 'kurkakola', -- Item ID.
price = 5 -- Price of the item.
},
{
item = 'wine', -- Item ID.
price = 10 -- Price of the item.
},
{
item = 'rolling_paper', -- Item ID.
price = 5 -- Price of the item.
},
{
item = 'firstaid', -- Item ID.
price = 25 -- Price of the item.
},
{
item = 'bandage', -- Item ID.
price = 15 -- Price of the item.
},
{
item = 'phone', -- Item ID.
price = 100 -- Price of the item.
},
{
item = 'radio', -- Item ID.
price = 50 -- Price of the item.
}
},
locations = { -- List of locations for the shop.
vector4(24.47, -1346.62, 29.5, 271.66), -- Location of the shop.
vector4(-3039.54, 584.38, 7.91, 17.27), -- Location of the shop.
vector4(-3242.97, 1000.01, 12.83, 357.57), -- Location of the shop.
vector4(1728.07, 6415.63, 35.04, 242.95), -- Location of the shop.
vector4(1959.82, 3740.48, 32.34, 301.57), -- Location of the shop.
vector4(549.13, 2670.85, 42.16, 99.39), -- Location of the shop.
vector4(2677.47, 3279.76, 55.24, 335.08), -- Location of the shop.
vector4(2556.66, 380.84, 108.62, 356.67), -- Location of the shop.
vector4(372.66, 326.98, 103.57, 253.73), -- Location of the shop.
vector4(-47.02, -1758.23, 29.42, 45.05), -- Location of the shop.
vector4(-706.06, -913.97, 19.22, 88.04), -- Location of the shop.
vector4(-1820.02, 794.03, 138.09, 135.45), -- Location of the shop.
vector4(1164.71, -322.94, 69.21, 101.72), -- Location of the shop.
vector4(1697.87, 4922.96, 42.06, 324.71), -- Location of the shop.
vector4(-1221.58, -908.15, 12.33, 35.49), -- Location of the shop.
vector4(-1486.59, -377.68, 40.16, 139.51), -- Location of the shop.
vector4(-2966.39, 391.42, 15.04, 87.48), -- Location of the shop.
vector4(1165.17, 2710.88, 38.16, 179.43), -- Location of the shop.
vector4(1134.2, -982.91, 46.42, 277.24), -- Location of the shop.
},
blip = { -- Blip settings for the shop.
enabled = true, -- Enable the blip.
sprite = 59, -- Blip sprite. (https://docs.fivem.net/docs/game-references/blips/)
colour = 2, -- Blip colour. (https://docs.fivem.net/docs/game-references/blips/)
scale = 0.6, -- Blip scale.
label = 'Store' -- Blip label.
}
},
["weapon_license"] = { -- Weapon license shop (dont change type for this shop).
ShopName = 'Ammunation - Weapon License', -- Name of the shop.
ShopDescription = 'Purchase a variety of class 1s, class 3s and ammo.', -- Description of the shop.
items = { -- List of items.
{
item = 'weapon_bat', -- Item ID.
price = 100, -- Price of the item.
limit = 2 -- Limit of the item (per restart) (not required).
},
{
item = 'weapon_pistol', -- Item ID.
price = 500, -- Price of the item.
limit = 1 -- Limit of the item (per restart) (not required).
},
{
item = 'weapon_microsmg', -- Item ID.
price = 1000, -- Price of the item.
limit = 1 -- Limit of the item (per restart) (not required).
},
{
item = 'weapon_smg_mk2', -- Item ID.
price = 1500, -- Price of the item.
limit = 1 -- Limit of the item (per restart) (not required).
},
{
item = 'pistol_ammo', -- Item ID.
price = 5, -- Price of the item.
},
{
item = 'smg_ammo', -- Item ID.
price = 10, -- Price of the item.
},
{
item = 'rifle_ammo', -- Item ID.
price = 15, -- Price of the item.
}
},
requirements = function(src) -- Requirements to access the shop (not required).
local Player = QBCore.Functions.GetPlayer(src) -- Get the player data.
if Player then -- If the player data exists.
return Player.PlayerData.metadata.licences.weapon -- Return true if the player has the weapon license.
end
return false -- Return false if the player data does not exist.
end,
locations = { -- List of locations for the shop.
vector4(-661.96, -933.53, 21.83, 177.05), -- Location of the shop.
vector4(809.68, -2159.13, 29.62, 1.43), -- Location of the shop.
vector4(1692.67, 3761.38, 34.71, 227.65), -- Location of the shop.
vector4(-331.23, 6085.37, 31.45, 228.02), -- Location of the shop.
vector4(-341.72, 6098.49, 31.32, 11.05), -- Location of the shop.
vector4(253.63, -51.02, 69.94, 72.91), -- Location of the shop.
vector4(23.0, -1105.67, 29.8, 162.91), -- Location of the shop.
vector4(2567.48, 292.59, 108.73, 349.68), -- Location of the shop.
vector4(-1118.59, 2700.05, 18.55, 221.89), -- Location of the shop.
vector4(841.92, -1035.32, 28.19, 1.56), -- Location of the shop.
vector4(-1304.19, -395.12, 36.7, 75.03), -- Location of the shop.
vector4(-3173.31, 1088.85, 20.84, 244.18), -- Location of the shop.
}
},
["no_weaponlicense"] = { -- No weapon license shop (dont change type for this shop).
ShopName = 'Ammunation - No Weapon License', -- Name of the shop.
ShopDescription = 'Purchase a large variety of melee weapons.', -- Description of the shop.
items = { -- List of items.
{
item = 'weapon_golfclub', -- Item ID.
price = 50, -- Price of the item.
},
{
item = 'weapon_knife', -- Item ID.
price = 50, -- Price of the item.
},
{
item = 'weapon_switchblade', -- Item ID.
price = 50, -- Price of the item.
},
{
item = 'weapon_poolcue', -- Item ID.
price = 50, -- Price of the item.
}
},
-- Dont need locations here because it is the same as the weapon license shop (do not change anything here except shop name, description and items).
}
}
}