Configuration
Customize the shop’s behavior by editing the Config.lua
and Settings.lua
files. Below is a concise example of the main configuration, with explanations for key options:
Custom Notification
Config.HelpNotifyFunction = function(message)
TriggerEvent("custom:helpnotify", message)
end
Config.NotifyFunction = function(message)
TriggerEvent("custom:notify", message)
end
Config = {}
-- Framework detection: "auto" (attempts to detect ESX or qb-core)
Config.Framework = "auto"
-- Shop operating hours (24-hour format)
Config.OpenHour = 0
Config.CloseHour = 24
Config.ShopClosedNotify = "The shop is closed! Opening hours: %02d:00 - %02d:00."
-- Payment methods accepted (cash and bankcard)
Config.PaymentMethods = {
cash = true,
bankcard = true
}
-- Blacklisted jobs: players with these jobs cannot access the shop
Config.BlacklistedJobs = { "police", "ambulance" }
-- Weapon handling settings
Config.UseWeaponsAsItems = false -- If true, weapons are treated as inventory items
Config.RequireWeaponLicense = false -- If true, a weapon license is required for purchase
Config.WeaponSpawnWithAmmo = true -- Note: If 'UseWeaponsAsItems' is true, this setting will not apply because weapons spawn as items (without visible ammo in the weapon)
-- Blip settings for shop locations
Config.Blips = true
Config.BlipSprite = 110
Config.BlipColor = 1
Config.BlipScale = 0.8
Config.BlipName = "Weapon Shop"
-- Marker settings for shop interaction
Config.Marker = false
Config.MarkerType = 29
Config.MarkerScale = 0.5
Config.MarkerColor = { r = 255, g = 0, b = 0, a = 100 }
-- NPC settings for shop locations
Config.NPC = {
Enabled = true,
Model = "s_m_y_ammucity_01",
Scenario = "WORLD_HUMAN_STAND_MOBILE"
}
-- Interaction text shown when near the shop
Config.ShopText = "~r~[~INPUT_PICKUP~] ~w~Open the Weapon Shop~n~~r~Gear up!"
-- Notification messages displayed in-game
Config.NotifyTexts = {
NotEnoughMoney = "You don't have enough cash!",
PurchaseSuccessCash = "You bought %s items for $%s (cash).",
NotEnoughBankCard = "You don't have enough money on your bank card!",
PurchaseSuccessBankCard = "You bought %s items for $%s (bank card).",
JobBlocked = "Your job is restricted from accessing the Weapon Shop!",
AlreadyOwnWeapon = "You already own this weapon!",
WeaponSinglePurchase = "Weapons can only be purchased once!",
WeaponLicenseRequired = "You need a weapon license!"
}
-- Custom notification functions (optional)
Config.HelpNotifyFunction = function(message)
-- Example: Use a custom event for help notifications
TriggerEvent("custom:helpnotify", message)
end
Config.NotifyFunction = function(message)
-- Example: Use a custom event for general notifications
TriggerEvent("custom:notify", message)
end
-- Shop locations and categories
Config.Shops = {
{ coords = vector3(22.0, -1107.2, 29.8), heading = 160.0, distance = 3.5 }, -- Pillbox Hill, Downtown Los Santos
{ coords = vector3(252.3, -50.0, 69.9), heading = 340.0, distance = 3.5 }, -- Downtown Vinewood, Los Santos
{ coords = vector3(-1305.2, -393.4, 36.7), heading = 75.0, distance = 3.5 }, -- Morningwood, Los Santos
-- Add more shop locations as needed
}
-- UI text for the shop interface
Config.UI = {
MainTitle = "Weapon Shop Risk Scripts",
MainDesc = "Discover a wide selection of high-quality weapons and gear to upgrade your arsenal and dominate your battles.",
ShoppingCartTitle = "Shopping Cart",
ShoppingCartDesc = "Review your selected items carefully before finalizing your purchase.",
TotalText = "Total",
PayByCash = "Pay by Cash",
PayWithBankCard = "Pay with Bank Card"
}
-- Category images and order for the UI
Config.CategoryImages = {
Pistols = "weapon-handguns.png",
Grenades = "Grenades.png",
Smg = "weapon-smgs.png",
Rifles = "weapon-long.png",
Melee = "weapon-melee.png",
Ammunition = "ammo.png"
}
Config.CategoryOrder = { "Pistols", "Smg", "Rifles", "Melee", "Ammunition" }
-- Items available in the shop (grouped by category)
Config.ShopItems = {
Pistols = {
{ name = "weapon_pistol", label = "Pistol", price = { min = 1, max = 1 }, ammo = 15, image = "Pistol.png", description = "A standard sidearm ideal for self-defense. Reliable and easy to use." }
},
Grenades = {
{ name = "weapon_grenade", label = "Grenade", price = { min = 1150, max = 1250 }, image = "grenade.png", description = "A lethal explosive device for clearing out enemies in tight spaces." }
},
Smg = {
{ name = "weapon_microsmg", label = "Micro SMG", price = { min = 1150, max = 1250 }, ammo = 50, image = "MicroSMG.png", description = "A compact SMG delivering deadly firepower in tight spaces." }
},
Rifles = {
{ name = "weapon_assaultrifle", label = "Assault Rifle", price = { min = 2450, max = 2550 }, ammo = 100, image = "AssaultRifle.png", description = "A balanced assault rifle offering reliable firepower." }
},
Melee = {
{ name = "weapon_knife", label = "Knife", price = { min = 290, max = 310 }, image = "Knife.png", description = "A fast and deadly knife for close combat." }
},
Ammunition = {
{ name = "ammo_pistol", label = "Pistol Ammo", price = { min = 45, max = 55 }, image = "PistolAmmo.png", description = "A box of pistol rounds providing enough ammo for standard use." }
}
}
Config.Discord = {
Webhook = "HERE",
ServerName = "My RP Server",
Message = "Hello dear players,\nMarket prices have just been updated!",
Color = 9323693,
IconURL = "https://files.catbox.moe/w2vub0.webp",
FooterText = "Your Server Team",
NotifyCategories = { "pistols", "smg", "rifles" }
}
Last updated