Weapons Black Market (ESX, QB)


Summary

this script provides a realistic black market system for ordering the rare weapons that you have set in config file

after player finished his order then the delivery box will be arrived from sky with an attached parachute



Video



Categories (tabs on menu)

at config file you can define or change the categories by your desire

for example you can change the tabs into : shotgun, sniper, pistol



Days System

you can set some weapons can be only sold on certain days like Thursday and Sundays for example, so the script will be challenging to buy some rare weapons

example : days = {‘monday’, ‘tuesday’, ‘wednesday’}



Quantity System

for each weapon you can set the stock count, for example you set the “Bullpup Rifle” quantity to 3, so after 3 of that is sold the status will be changed to “out of stock

this also will increase the challenging



How it Works

  1. player goes to the markers or uses /weapons command for opening the menu (command name is changeable)

  2. after selecting the weapons he pays from bank account

  3. a timer will be shown with a pulsing blip and selected coordination

  4. after the timer is finished the delivery box with an attached parachute will appear on sky

  5. then it lands and player gets his order



Possible Cases

1. player gets dc

at this case the order will be canceled, money will return into his bank account and the quantity of the weapons that he ordered will be added to the shop again

2. canceling the order before arrival

player can cancel the order before delivery arrives but some of the money will be deducted as a penalty and the reset of the money will return to his bank account (for example 20% penalty)

3. not taking the order

if the delivery box has been arrived and player does not take it after a certain time then again there is penalty for the return money but with more percentage (for example 40% penalty)



Easy to Setup

adding the weapons are very easy and there are examples for the structure and you can also config everything at config.lua



Features

  • players can open the menu by going to markers or using /command
  • easy to setup
  • you can change everything at config file
  • you can add and define categories and weapons easly
  • you can set some weapons can be sold only at certain days
  • there is stock system
  • not bug at all (we tested every case)
  • considered all possible cases and for each there is a feedback
  • commands are changeable at config file
  • very cool and realistic UI
  • good performance 0.01 ms (passive) and 0.02 - 0.03 ms (while ordering)
  • very unique and new idea (no one did this before)
  • supporting all versions of esx and qbcore



Requirements

  • ESX or QB
  • t-notify (optional)

Config File


Config = {}

-- ESX OPTIONS
Config.UseESX = true -- if you are using esx
Config.ESXTrigger = "esx:getSharedObject" -- Put your ESX Object Trigger Right Here
Config.ESXLegacyLatestVersion = false -- if you are using the last version of esx legacy then set it true
-- also you need to add this code on fxmanifest.lua and set Config.ESXTrigger empty
-- shared_script '@es_extended/imports.lua'

-- QB OPTIONS
Config.UseQB = false -- if you are using qb
Config.QBExport = "qb-core" -- Put your QB Object Export

Config.OpenMenuByCommand = true -- if u set it false then u have to use markers for opening the menu, also you can use both
Config.CallCommand = 'weapons'
Config.CancelCommand = 'cancelweapon'

Config.UsingMarkers = true
Config.DrawDistance = 30
Config.MarkerPoints = {
	[1] = {
		Coords = vector3(120.81, -1576.98, 29.6),
		Marker = {
			Size  = { x = 1.2, y = 1.2, z = 1.2 },
			Color = { r = 255, g = 0, b = 0 },
			Type  = 41,
			Rotate = true,
		},
		Blip = {
			Show = true,
			BlipSize = 1.2,
			BlipID = 439,
			BlipColor = 3,
			BlipText = 'Weapon Market'
		}
	},
}


Config.UsingTNotify = true --if false then it will use the default esx or qb notification

Config.Categories = {
	[1] = { -- must be a unique index number
		id = 'rifle', -- must be unique and lower case
		label = 'Rifls', -- can be upper case
		items = {
			weapon_advancedrifle = { -- must be the exact name that exist on database
				label = 'Advanced Rifle',
				price = 20000,
				image = 'weapon_advancedrifle.png', -- image name at img folder
				count = 20, -- if u put the count to -1 then it will become unlimited
				days  = {'monday', 'tuesday', 'wednesday'}, -- which days this weapon can be available to be bought
				info  = 'only available on monday, tuesday, wednesday' -- if you want to add info about which days this weapon is available
				-- when player move mouse over the item the info will show up
			},
			weapon_assaultrifle = {
				label = 'Assault Rifle',
				price = 15000,
				image = 'weapon_assaultrifle.png',
				count = -1,
				days  = {}, -- if u want this weapon be available everyday
				info  = ''
			},
			weapon_assaultsmg = {
				label = 'Assault SMG',
				price = 10000,
				image = 'weapon_assaultsmg.png',
				count = 20,
				days  = {'thursday', 'tuesday'},
				info  = 'only available on thursday and tuesday'
			},
			weapon_bullpuprifle = {
				label = 'Bullpop Rifle',
				price = 12000,
				image = 'weapon_bullpuprifle.png',
				count = 1,
				days  = {},
				info  = ''
			},
		}
	},
	[2] = {
		id = 'smg',
		label = 'Smg',
		items = {
			weapon_smg = {
				label = 'SMG',
				price = 5000,
				image = 'weapon_smg.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_minismg = {
				label = 'Mini SMG',
				price = 5000,
				image = 'weapon_minismg.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_microsmg = {
				label = 'Micro SMG',
				price = 5000,
				image = 'weapon_microsmg.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_machinepistol = {
				label = 'Machine Pistol',
				price = 5000,
				image = 'weapon_machinepistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
		}
	},
	[3] = {
		id = 'pistol',
		label = 'Pistol',
		items = {
			weapon_combatpistol = {
				label = 'Combat Pistol',
				price = 2000,
				image = 'weapon_combatpistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_snspistol = {
				label = 'SNS Pistol',
				price = 500,
				image = 'weapon_snspistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_pistol50 = {
				label = 'Pistol50',
				price = 4000,
				image = 'weapon_pistol50.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_pistol = {
				label = 'Pistol',
				price = 1000,
				image = 'weapon_pistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_heavypistol = {
				label = 'Heavy Pistol',
				price = 3000,
				image = 'weapon_heavypistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
			weapon_vintagepistol = {
				label = 'Vintage Pistol',
				price = 1200,
				image = 'weapon_vintagepistol.png',
				count = 20,
				days  = {},
				info  = 'Some Info'
			},
		}
	}
}

-- delivery

Config.MessageIcon = 'CHAR_BLANK_ENTRY'
Config.DeliveryName = 'Black Market'
Config.DeliveryEmployeeName = 'mr X'
Config.DropBoxDistance = 100
Config.GetWeaponsKey = 38 -- by default [E]
Config.BoxModel = 'imp_prop_impexp_boxwood_01'
Config.FreezeBoxAfterDrop = true -- when the box reaches out the ground it gets freezed so it wont move
Config.UsingFlareForBox = true -- when the delivery box is dropped then use a flare to player, this feature uses ShootSingleBulletBetweenCoords function so if your anti cheat has problem with that set it false
Config.UsingSoundOnBox = true -- a sound will play when player gets close to the box
Config.TextColorAboveBox = {r = 255, g = 255, b = 255} -- text color that shows up above the box, in locale file its about ['take_your_order']
Config.WeaponAmooWhenTaken = 100 -- how many bullets player takes for each gun when he took his order
Config.PenaltyPercentage = 20 -- if player cancels the order 30 percentage of the total money will decrease and the reset will return to his bank account
Config.PenaltyPercentageForNotTaking = 40 -- if delivery box is arrived but player does not take it then after a certain time delivery will be canceled but with more penalty
Config.TimerAfterDelivery = 10 -- after the box landed on the ground player has 1 minute to take it otherwise the order will be canceled

-- remember to add many points because if a point is busy by a buyer then that point cannot be used by another player and has to wait until the buyer gets done with it
-- and if all the points are busy then a message will tells the player to wait
Config.DeliveryPoints = {
	[1] = {
		Coords = vector3(-1522.49, -2596.61, 14.0),
		Timer = 1, -- in seconds, after 200 seconds the order will be dropped from sky
		BoxBlipID = 94,
		BoxBlipColor = 3,
		BoxBlipSize = 1.0,
		BoxBlipName = 'Delivery Box',
		ParachuteModel = "prop_v_parachute",
	},
}

--[[ other parachutes model :
	"p_parachute1_mp_dec",
	"p_parachute1_sp_dec",
	"p_parachute1_mp_s"
	"p_parachute1_sp_s"
	"sr_prop_specraces_para_s_01"
	"pil_p_para_pilot_sp_s"
	"lts_p_para_pilot2_sp_s"
	"p_parachute1_s"
	"p_cargo_chute_s"
	"xm_prop_x17_para_sp_s"
	"gr_prop_gr_para_s_01"
	"sr_prop_specraces_para_s"
]]--



Tebex Link

for buying the script click here



my Biggest projects

HUNK-AC (the most complate 2022 fivem anti cheat)

ESX Society Remastered + More Options



my Other Scripts

Advanced Lock System (QB, ESX)
Uber Eats (ESX, QB)
ESX Society Remastered
Realistic Fast Food
ESX Car Bomb
ESX Books + Reading
VIP List + Test Drive
ESX Crafting System
QB Crafting System
ESX Jobs List
ESX Document Robbery
ESX Multiple Simcards
Realistic Coffee Job (ESX)



Code is accessible No
Subscription-based No
Lines (approximately) 1000
Requirements ESX or QB
Support Yes
1 Like

hello, is it possible to add items instead of weapons?

1 Like

I’m making a black market for items soon, so when I released I will notify you but this one is only for weapons my friend :slight_smile:

I wish I had both in one XD