Illegal Dealer
Illegal Dealer
Overview
The Illegal Dealer script allows players to engage in underground transactions within the game, providing a reputation system that tracks their activity and purchases. Players can buy and sell items, such as marked bills, enhancing the roleplay experience. The script features a user-friendly interface and integrates seamlessly with existing inventory systems.
Compatibility
Framework: ESX, QBCore, QBox, Standalone
Target: ox_target, qb-target, or qtarget (optional) — falls back to 3D text / TextUI if none are installed
Dependencies
Required Dependencies
- oxmysql
- es_extended / qbcore / qbox
Optional Dependencies
- ox_lib
- ox_target or qb-target
Installation
1. Upload the resource
Place the resource folder inside your server's resources directory (rename it to drc_illegaldealer if needed).
2. Install dependencies
Make sure all of the following are installed and started before this script:
oxmysqles_extendedqtarget
3. Import database
This script uses a database. Import the included drc_illegaldealer/install/sql.sql — or run the following SQL directly:
CREATE TABLE IF NOT EXISTS `drc_illegalvan` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(60) NOT NULL,
`reputation` INT(11) NOT NULL DEFAULT 0,
`total_purchases` INT(11) NOT NULL DEFAULT 0,
`total_spent` INT(11) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `drc_illegalvan` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`identifier` VARCHAR(60) NOT NULL,
`reputation` INT(11) NOT NULL DEFAULT 0,
`total_purchases` INT(11) NOT NULL DEFAULT 0,
`total_spent` INT(11) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `identifier` (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
4. Add to server.cfg
ensure oxmysql
ensure es_extended
ensure qtarget
ensure drc_illegaldealer
5. Configure the script
Open the config file and adjust the settings for your server. See the Config section below.
6. Restart and test
Restart your server (or start the resource) and test it in-game, e.g. with /mission.
Config
drc_illegaldealer/shared/sh_config.lua
Config = {}
Config.Debug = false -- Set to true to enable debug prints in console
Config.NotifyType = 'ox_lib' -- 'ox_lib', 'esx', 'qb'
Config.NUIColor = '#c8a84e' -- change hex his to change menu colour
-- ============================================
-- FRAMEWORK & INTERACTION
-- ============================================
Config.NewESX = true
Config.Framework = 'ESX' -- 'ESX' or 'QB'
Config.Interaction = 'target' -- 'target' or '3dtext'
Config.Target = 'qtarget' -- 'qtarget', 'ox_target' or 'qb-target'
-- ============================================
-- EXCLUDED JOBS
-- ============================================
-- Jobs excluded from SMS, mission blips, mission notifications and payphone access (government jobs)
Config.ExcludedJobs = {
"police",
"lspd",
"bcso",
"sheriff",
"sasp",
"fib",
"doj",
"ambulance",
"doctor",
"ems",
"fire",
}
-- ============================================
-- PHONE / SMS CONFIG
-- ============================================
Config.Phone = 'lb-phone' -- 'lb-phone', 'qs-smartphone', 'gksphone', 'high-phone', 'yseries', '17mov_Phone', 'okokPhone', 'roadphone', 'jpr-phonesystem', 'sbf_phone' or false to disable
Config.DealerPhoneNumber = 'Unknown' -- Phone number from which SMS is sent
Config.SMSEnabled = true -- Enable SMS when van spawns
Config.SMSMaxRecipients = 5 -- Maximum number of players who will receive SMS
-- ============================================
-- ILLEGAL VAN CONFIG
-- ============================================
Config.Van = {
Model = 'speedo5', -- Van model
AutoSpawn = true, -- true = van spawns automatically on timer, false = van only spawns via payphone summon
SpawnInterval = 30 * 60 * 1000, -- Every 30 minutes (in milliseconds) — only used when AutoSpawn = true
DespawnAfter = 15 * 60 * 1000, -- Despawn after 15 minutes
BlipSprite = 458, -- Blip icon
BlipColor = 1, -- Red blip color
BlipScale = 0.8,
BlipName = "Illegal Dealer",
BlipVisible = 'sms', -- 'all' = everyone sees blip, 'sms' = only SMS recipients, false = blip disabled
InteractDistance = 2.5, -- Interaction distance (3D text)
ArmorLevel = 1, -- Armor plating (0=none, 1=20%, 2=40%, 3=60%, 4=80%, 5=100%)
}
-- Spawn time restriction (only applies when AutoSpawn = true)
Config.Time = {
enabled = false, -- true = van only spawns during the time window below, false = no restriction
from = 20, -- Start hour (0-23) — 20 = 8 PM
to = 6, -- End hour (0-23) — 6 = 6 AM (supports overnight ranges like 20->6)
}
-- Random spawn locations with custom SMS messages and hints
-- smsMessage = message that will be sent to players
-- hint = hint for the location (optional, used by payphone)
Config.SpawnLocations = {
{
coords = vector4(2892.0100, 4381.4565, 50.3395, 0.2457),
name = "Grapeseed",
smsMessage = "Yo, I got that fresh stock ready. Meet me out by the farms in Grapeseed, come alone.",
hint = "Head north out of the city towards Grapeseed. Look around the farmland area."
},
{
coords = vector4(258.0211, -14.0480, 73.6879, 255.6921),
name = "DOWNTOWN VINEWOOD",
smsMessage = "I'm posted up in Downtown Vinewood right now. Pull up quick before I dip.",
hint = "Check the streets of Downtown Vinewood, near the main boulevard."
},
{
coords = vector4(-1396.2916, -653.6628, 28.6736, 213.4028),
name = "DEL PERRO",
smsMessage = "Swing by Del Perro, I'm parked near the Bahama Mamas club. Don't keep me waiting.",
hint = "Head to Del Perro, look near the Bahama Mamas West nightclub."
},
{
coords = vector4(-1159.4617, -1565.7347, 4.4274, 117.2902),
name = "SAN ANDREAS / GOMA ST",
smsMessage = "I'm down by the beach on Goma Street. Look for the van near the smoke shop.",
hint = "Go to Goma Street near the beach. Check around the smoke shop area."
},
{
coords = vector4(471.6491, 3567.5535, 33.2385, 220.2667),
name = "GRAND SENORA DESERT",
smsMessage = "I'm out in the desert off Marina Drive. Long drive but worth it, trust me.",
hint = "Head out to Grand Senora Desert. Look along Marina Drive near the roadside."
},
}
-- NPC configuration (freely placed in the van using offset)
Config.NPCs = {
{
model = 's_m_y_dealer_01',
offset = vector3(-0.5, -2.3, 0.9),
heading = 200.0,
anim = {
dict = 'anim@amb@business@cfm@cfm_machine_no_work@',
name = 'hanging_out_operator',
loop = true
}
},
}
-- Props in the van
Config.VanProps = {
{
model = 'xm3_prop_xm3_crate_ammo_01a',
offset = vector3(0.0, -1.5, -0.2),
rotation = vector3(0.0, 0.0, 0.0)
},
}
-- ============================================
-- WEAPON SHOP
-- ============================================
-- Random stock settings for each spawn
Config.StockSettings = {
minStock = 1,
maxStock = 10,
}
-- Reputation settings
Config.Reputation = {
enabled = true,
perPurchase = 1, -- Reputation gained per purchase (per transaction, not per item)
bonusPerExpensiveItem = 2, -- Extra reputation for items costing more than the threshold below
expensiveThreshold = 20000,
}
-- stock = {min, max} - random amount on each spawn
-- requiredRep = minimum reputation for purchase (optional)
-- rarity = "COMMON", "RARE", "HOT", "LEGENDARY" (optional)
Config.WeaponShop = {
BlackMoney = false, -- false = normal money/cash, true = ESX black_money / QB markedbills
{
label = "Weapons",
items = {
{name = "WEAPON_PISTOL", label = "Pistol", price = 5000, prop = "w_pi_pistol", stock = {3, 8}, rarity = "COMMON", requiredRep = 0},
{name = "WEAPON_COMBATPISTOL", label = "Combat Pistol", price = 7500, prop = "w_pi_combatpistol", stock = {2, 6}, rarity = "COMMON"},
{name = "WEAPON_PISTOL50", label = "Pistol .50", price = 12000, prop = "w_pi_pistol50", stock = {1, 4}, rarity = "RARE", requiredRep = 10},
{name = "WEAPON_MICROSMG", label = "Micro SMG", price = 15000, prop = "w_sb_microsmg", stock = {2, 5}, rarity = "COMMON"},
{name = "WEAPON_SMG", label = "SMG", price = 18000, prop = "w_sb_smg", stock = {1, 4}, rarity = "RARE", requiredRep = 15},
{name = "WEAPON_ASSAULTSMG", label = "Assault SMG", price = 22000, prop = "w_sb_assaultsmg", stock = {1, 3}, rarity = "RARE", requiredRep = 20},
{name = "WEAPON_ASSAULTRIFLE", label = "Assault Rifle", price = 35000, prop = "w_ar_assaultrifle", stock = {1, 2}, rarity = "HOT", requiredRep = 30},
{name = "WEAPON_CARBINERIFLE", label = "Carbine Rifle", price = 30000, prop = "w_ar_carbinerifle", stock = {1, 3}, rarity = "HOT", requiredRep = 25},
{name = "WEAPON_ADVANCEDRIFLE", label = "Advanced Rifle", price = 40000, prop = "w_ar_advancedrifle", stock = {1, 2}, rarity = "LEGENDARY", requiredRep = 50},
}
},
{
label = "Ammo",
items = {
{name = "ammo-9", label = "9mm Ammo (50x)", price = 500, prop = "prop_ld_ammo_pack_03", stock = {5, 15}, rarity = "COMMON"},
{name = "ammo-45", label = ".45 ACP Ammo (50x)", price = 600, prop = "prop_ld_ammo_pack_03", stock = {5, 12}, rarity = "COMMON"},
{name = "ammo-rifle", label = "Rifle Ammo (50x)", price = 1000, prop = "prop_ld_ammo_pack_02", stock = {3, 8}, rarity = "RARE", requiredRep = 10},
}
},
{
label = "Body Armor",
items = {
{name = "bulletproof", label = "Bulletproof Vest", price = 2500, prop = "prop_armour_pickup", stock = {2, 5}, rarity = "COMMON"},
}
}
}
-- ============================================
-- PAYPHONE CONFIG
-- ============================================
Config.Payphone = {
enabled = true,
summonVan = true, -- true = players can summon the van via payphone, false = disabled
questions = {
{ id = 'summon', icon = 'fas fa-truck' },
{ id = 'location', icon = 'fas fa-map-marker-alt' },
{ id = 'stock', icon = 'fas fa-box' },
{ id = 'mission', icon = 'fas fa-crosshairs' },
{ id = 'reputation', icon = 'fas fa-star' },
},
}
-- ============================================
-- DEALER MISSIONS CONFIG
-- ============================================
Config.MissionBlip = {
visibleToAll = false, -- true = all players see blips, false = only the mission starter sees blips
}
Config.MissionNotification = {
type = 'sms', -- 'sms' = phone SMS, 'notification' = ox_lib notify, 'none' = disabled
sendTo = 'random', -- 'random' = random eligible players, 'all' = all eligible players, 'starter' = only mission starter
maxRecipients = 5, -- Max players to notify (only used when sendTo = 'random')
smsMessage = "Dealer needs help. There's a job waiting for you.",
notifyMessage = "The dealer has a mission available!",
}
Config.MissionCooldown = 10 * 60 * 1000 -- 10 minutes in milliseconds
Config.MissionTimeout = 30 * 60 * 1000 -- 30 minutes — auto-reset if not completed in time (0 = disabled)
Config.MissionDescription = "Go to the marked location, kill the guards and find the black box with the dealer chip. You can keep the rest of the loot!"
-- Chip reward settings (give dealer_chip at van for reputation)
Config.ChipReward = {
item = 'dealer_chip',
reputation = 10,
}
-- Each mission has multiple crates. Each crate contains a specific item.
-- Player loots each crate individually with a synced scene animation.
-- One mission is randomly selected when a player starts a dealer mission.
--
-- type = "BigCrate" or "SmallCrate"
-- BigCrate = Drug Wars crate loot (xm3_prop_xm3_crate_01a -> 01b, with can + crowbar)
-- SmallCrate = Criminal Enterprises empty crate (ex_prop_adv_case)
--
-- itemProp = prop model spawned near opened crate after looting
Config.DealerMission = {
{
name = "Grapeseed Stash",
blipSprite = 478,
blipColor = 2,
blipScale = 0.9,
blipName = "Mission Crate",
npcs = {
{ model = 's_m_y_dealer_01', coords = vector4(2198.4333, 5610.1787, 53.4719, 341.1270), weapon = 'WEAPON_PISTOL' },
{ model = 'g_m_y_mexgoon_01', coords = vector4(2195.6882, 5611.8467, 53.6895, 308.4433), weapon = 'WEAPON_MICROSMG' },
{ model = 'g_m_y_mexgoon_01', coords = vector4(2207.5603, 5611.1245, 53.7041, 7.1767), weapon = 'WEAPON_MICROSMG' },
{ model = 's_m_y_dealer_01', coords = vector4(2201.9038, 5620.5278, 54.4983, 245.9050), weapon = 'WEAPON_PISTOL' },
},
crates = {
{ type = 'BigCrate', coords = vector3(2194.3579, 5608.7637, 52.6313), heading = 74.9720, item = 'ammo-9', count = 50, itemProp = 'prop_ld_ammo_pack_03' },
{ type = 'SmallCrate', coords = vector3(2198.1099, 5607.3730, 52.7108), heading = 266.8365, item = 'WEAPON_PISTOL', count = 1, itemProp = 'w_pi_pistol' },
{ type = 'BlackBox', coords = vector3(2196.1411, 5604.6113, 52.8047), heading = 167.8819, item = 'dealer_chip', count = 1, itemProp = 'prop_cs_heist_usb' },
},
},
}