NR_PawnShop

A simple and efficient pawn shop script for QBX/QBCore that allows players to sell items to an NPC vendor for cash.

Features

Dependencies

Resource Description Required
qbx_core Core framework Yes
ox_lib UI library (context menus, input dialogs) Yes
ox_target Interaction system Yes
ox_inventory Inventory system Yes

Installation

Step 1: Download

Download NR_PawnShop and extract it to your resources folder:

server/
  └── resources/
      └── [nightrider]/
          └── NR_PawnShop/

Step 2: server.cfg

Add the resource to your server configuration:

ensure NR_PawnShop

Step 3: Configuration

Configure the location, ped model, and item prices in cl_main.lua.

Step 4: Restart

Restart your server to load the resource.

⚠️ Dependencies

Make sure qbx_core, ox_lib, ox_target, and ox_inventory are all started before NR_PawnShop in your server.cfg.

How It Works

1. Finding the Shop

A blip appears on the map marking the pawn shop location (default: near Grove Street). Players navigate to the location and find an NPC vendor.

2. Opening the Menu

Approach the NPC and use ox_target (third eye) to interact. Select "Sell Items" from the target menu.

3. Selecting Items

A context menu opens showing all sellable items currently in the player's inventory. Each item displays the item name, price per unit, and quantity owned.

4. Selling

Click on an item to sell. An input dialog appears asking how many to sell, showing the available quantity and price per unit. Enter the amount and confirm.

5. Transaction Complete

Items are removed from inventory, cash is added to the player's account, and a success notification shows the total amount earned.

Configuration

Location & NPC Settings

PedLocation = vec4(149.25, -1714.29, 29.32, 140.29) -- x, y, z, heading
PedModel = 'a_m_m_business_01' -- Ped model hash

Blip Customization

BlipSprite = 605     -- Blip icon ID
BlipScale = 0.7      -- Blip size
BlipColor = 2        -- Blip color (2 = green)
BlipName = "Pawn Shop" -- Label on map

Item Pricing

Edit the Items table in the config to add/remove items or change prices:

Items = {
    ['itemname'] = price,
    ['goldbar'] = 10000,
    ['diamond'] = 3000,
    -- Add custom items here
}

Supported item categories:

Customization

Changing the Ped Model

Update PedModel with any valid ped model:

PedModel = 's_m_y_dealer_01'     -- Drug dealer appearance
PedModel = 'a_m_m_hillbilly_01' -- Hillbilly appearance
PedModel = 'g_m_m_chigoon_01'   -- Chinese gangster

Modifying Ped Animation

In the ped spawn thread, change the scenario:

TaskStartScenarioInPlace(StorePed, "WORLD_HUMAN_SMOKING", 0, true)         -- Smoking
TaskStartScenarioInPlace(StorePed, "WORLD_HUMAN_STAND_IMPATIENT", 0, true) -- Impatient

Changing Payment Method

Modify the server event to pay differently:

-- Current: Pays in cash
Player.Functions.AddMoney('cash', totalPrice)

-- Alternative: Pay to bank
Player.Functions.AddMoney('bank', totalPrice)

-- Alternative: Split payment
Player.Functions.AddMoney('cash', totalPrice * 0.7)
Player.Functions.AddMoney('bank', totalPrice * 0.3)

Security Features

Client-Side Validation

Server-Side Validation

Performance

Metric Value
Resmon impact ~0.00ms (idle), ~0.01ms (menu open)
Network traffic Minimal (only on transactions)
Database queries None (uses ox_inventory queries)
Threads 3 total (blip, ped spawn, ox_target setup)

Troubleshooting

Ped not spawning

Items not showing in menu

Can't interact with ped

Transaction failing

Menu not opening

Support

Need help? Join our Discord server for community support and updates.