GR1M Docs

Pawn

A comprehensive, fully-featured pawnshop system for FiveM with dynamic economy, multi-shop support, and a modern React UI.

v1.0.0Needs ox_lib, oxmysql, ox_inventory

#Features

#Dependencies

#Installation

  1. Download & Extract - Place gr1m_pawn in your resources folder
  2. Build the UI:
     cd resources/gr1m_pawn/web
  3. Add to server.cfg:
     ensure ox_lib
     ensure oxmysql
     ensure ox_inventory
     ensure ox_target
     ensure gr1m_pawn
  4. Start your server - The database tables will be created automatically!

#Manual SQL Installation (Optional)

If auto-install fails or you prefer manual control:

# Import install.sql into your database manually
mysql -u root -p your_database < install.sql

#Post-Installation

  1. Configure shops in config.lua - Set locations, prices, NPCs
  2. Set up ACE permissions (optional):
     add_ace group.admin command.pawnshop_admin allow
     add_ace group.admin command.pawnshop_create allow

#Commands

CommandDescriptionPermission
/pawnshop_reinstallForce database reinstallationAdmin
/pawnshop_updatepricesManually trigger price updateAdmin
/pawnshop_create [name]Create new shop at locationAdmin
/pawnshop_delete [shopId]Delete a shopAdmin

#Default Locations

Three pawnshops are pre-configured:

#Configuration

#Economy Settings (config.lua)

Config.Economy = {
    fluctuationInterval = 30,  -- Price update interval (minutes)
    maxPriceDeviation = 0.5,   -- Max 50% price deviation
    
    supplyDemand = {
        priceDropPerBatch = 0.02,   -- 2% price drop per 10 items
        batchSize = 10,
        maxPriceDrop = 0.5,
        priceRisePerBatch = 0.03,   -- 3% price rise when low stock
        lowStockThreshold = 5,
        maxPriceRise = 0.5,
    },
    
    profitMargins = {
        minBuyMargin = 0.5,    -- Shop buys at 50% minimum
        maxBuyMargin = 0.9,    -- Shop buys at 90% maximum
        minSellMargin = 1.1,   -- Shop sells at 110% minimum
        maxSellMargin = 2.0,   -- Shop sells at 200% maximum
    }
}

#Adding Items

Edit Config.ItemCategories in config.lua:

['jewelry'] = {
    items = {
        ['diamond_ring'] = { 
            basePrice = 2500, 
            volatility = 0.15  -- Price fluctuation amount
        },
    }
}

#Blacklisting Items

Items that cannot be pawned:

Config.BlacklistedItems = {
    'id_card',
    'phone',
    -- etc
}

#How It Works

#For Players

  1. Browse Shop - View available items with current prices
  2. Sell Items - Sell from inventory with quality affecting price
  3. Buy Items - Purchase from shop stash
  4. View Trends - See price history charts

#For Shop Owners

  1. Purchase Shop - Buy unowned shops via target interaction
  2. Manage Settings - Adjust shop identity, requirements, and transaction rules
  3. Manage Accepted Items - Choose which approved stolen goods the pawn broker ped will accept
  4. Deposit Dirty Money - Stock the shop's dirty reserve and credit the configured clean percentage
  5. Withdraw Clean Cash - Pull laundered clean money out of the shop
  6. View Logs - Full transaction history

#Economy System

#Troubleshooting

#Database Issues

If auto-install fails:

# Check if tables exist
SELECT * FROM information_schema.tables 
WHERE table_schema = 'your_database' 
AND table_name LIKE 'pawnshop%';

# Run manual install
mysql -u root -p your_database < install.sql

#UI Not Loading

  1. Check build exists: web/build/index.html
  2. Check browser console for errors

#Items Not Showing

#Support

For issues and feature requests, please use the GitHub issues page.

#License

MIT License - Feel free to modify and distribute.

#Credits