prp-pawn
Modern NUI pawn shop for scavenging and loot-heavy gameplay. Server-authoritative, multi-framework (Qbox/QBCore/ESX). Version 1.0.0.
Highlights
Modern NUI — Dark theme with amber accents, category filtering, shopping cart, and image previews.
Smart Pricing — Premium items with explicit min/max prices; generic items auto-priced from base value (22–30% default). Blacklist and category patterns.
Economy Controls — Per-transaction cap, daily sell limit per player, sale cooldowns. Server-authoritative validation.
Haggle System — Simple mode (random chance) or skill mode (timing minigame). Gold/green/yellow/red zones; one attempt per visit.
Security — Session-based cart validation, anti-spoof, full transaction logging.
Multi-Framework — Auto-detects Qbox, QBCore, ESX. Works with ox_inventory; ox_target or qb-target recommended (set Config.Target = 'none' for key-press fallback). Notify: ox_lib, okok, mythic, wasabi, t-notify, ps-ui, qb, esx, chat.
Installation
- Ensure dependencies are started first:
ensure ox_lib ensure ox_inventory ensure ox_target # Recommended; or key-press fallback ensure qbx_core # or qb-core / es_extended - Add
ensure prp-pawnto yourserver.cfgafter dependencies. - Configure
config/config.lua(economy caps, premium items, shops, haggle). - Restart the server. Run
/pawn:doctorin-game for diagnostics.
Configuration
Main config file: config/config.lua.
Economy
Config.Economy = {
PerTransactionCap = 8000, -- Max payout per sale
DailySellCap = 25000, -- Max daily earnings per player
SaleCooldown = 2, -- Seconds between sales
}
Premium Items
High-value items with explicit min/max prices:
Config.PremiumItems = {
['weapon_pistol'] = {
label = 'Pistol',
price = { min = 800, max = 1200 },
category = 'weapons'
},
['goldbar'] = {
label = 'Gold Bar',
price = { min = 5000, max = 8000 },
category = 'valuables'
},
}
Generic Pricing
Fallback for items not in PremiumItems:
Config.GenericPricing = {
PercentMin = 0.22, -- Min 22% of base value
PercentMax = 0.30, -- Max 30%
MaxPrice = 250,
UnknownBaseValue = { min = 1, max = 5 },
}
Blacklist
Config.Blacklist = { 'cash', 'money', 'black_money', 'id_card', 'driver_license' }
Config.BlacklistPatterns = { '^key_', '^quest_' }
Loadout Items
Very low pricing for free job/armory gear (anti-exploit). Overrides PremiumItems for matching entries.
Config.LoadoutItems = {
['weapon_pistol'] = { label = 'Pistol', price = { min = 10, max = 25 }, category = 'weapons' },
['weapon_nightstick'] = { label = 'Nightstick', price = { min = 2, max = 5 }, category = 'weapons' },
}
Config.LoadoutPatterns = { '^police_', '^ems_', '^job_', '^loadout_' }
Base Values
Used for generic pricing when an item is not in PremiumItems and ox_inventory has no price metadata.
Config.BaseValues = {
['scrapmetal'] = 50,
['plastic'] = 40,
['bandage'] = 100,
}
Shops
Config.Shops = {
['downtown'] = {
name = 'Downtown Pawn Shop',
coords = vec4(412.34, 314.81, 103.13, 207.0),
radius = 1.5,
spawnPed = true,
pedModel = 'a_m_y_hipster_01',
hours = { min = 0, max = 24 },
account = 'cash',
blip = { enabled = true, sprite = 59, color = 46, scale = 0.8, label = 'Pawn Shop' },
},
}
Haggle (Skill Mode)
Timing minigame: stop the needle in gold (+20–30%), green (+10–20%), yellow (+0–8%), or red (−3–10%).
Config.Haggle = {
Mode = 'skill',
CooldownMinutes = 8,
Skill = {
Speed = 0.85,
Zones = { red = { ... }, yellow = { ... }, green = { ... }, gold = { ... } },
TierRanges = { gold = { min = 0.20, max = 0.30 }, green = { ... }, ... },
},
}
Admin Commands
/pawn:doctor— Run diagnostics (group.admin)/pawn:toggledebug— Toggle debug mode (group.admin)
Troubleshooting
- Items not appearing — Check blacklist; verify item exists in ox_inventory and has base value (or is in PremiumItems / LoadoutItems / BaseValues).
- Shop not opening — Check shop hours in config; ensure ox_target (or qb-target) is running, or set
Config.Target = 'none'for key-press/TextUI fallback; check console for errors. - Sales failing — Check daily cap; verify player has items; session may have expired.
Run /pawn:doctor and enable Config.Debug or /pawn:toggledebug for more detail.
img/haggle-ui.png). Economy tips: Set PremiumItems below shop purchase cost to prevent buy-low-sell-high; use LoadoutItems for free job gear; blacklist cash, keys, quest items.