DMD Store OX Fuel Job System | Job-Based Fuel Management | QB ESX
DMD-OX-Fuel-Job
An advanced fuel system for FiveM servers with job-based free fuel, ox_inventory integration, and realistic refueling mechanics.
OX Fuel Job extends the popular ox_fuel system with employment perks - police and ambulance workers receive complimentary fuel while civilians pay market rates. Perfect for serious roleplay servers requiring realistic economy systems.
Fully integrated with ox_inventory for seamless money transactions and petrol can management.
---
FEATURES
Job-Based Fuel System
- Free fuel for police officers
- Free fuel for ambulance/EMS workers
- Standard pricing for civilian players
- Automatic job detection via ESX
- Real-time payment processing
Advanced Fueling Mechanics
- Progressive fuel addition (ticks every 250ms)
- Customizable refill rates (0.50% per tick default)
- Dynamic pricing per tick ($1.50 default)
- Realistic fueling duration calculations
- Smooth progress animations
Petrol Can System
- Purchase petrol cans at gas stations
- Refill existing petrol cans
- Durability-based consumption (1.3% per tick)
- Inventory weight checking
- Automatic metadata updates
- Job-based discounts (free for emergency services)
Gas Station Management
- Nearest station blip display (5000ms intervals)
- Show all stations option
- Show no stations option (stealth mode)
- Multiple pump model support (7 different props)
- Custom station location system
OX Integration
- ox_lib dependency (v3.22.0+ required)
- ox_inventory integration (v2.30.0+ required)
- ox_target support (toggle-able)
- Locale system for multi-language
- Version checking system
---
CONFIGURATION
Basic Settings
Config.versionCheck = true -- Check for updates
Config.ox_target = true -- Enable ox_target interactions
Blip Display Options
Config.showBlips = 1
-- 0 = Hide all blips
-- 1 = Show nearest station only (5000ms update interval)
-- 2 = Show all stations
Refueling Settings
Config.refillValue = 0.50 -- Fuel added per tick (0.50%)
Config.refillTick = 250 -- Tick interval in milliseconds
Config.priceTick = 1.5 -- Cost per tick ($1.50)
Config.durabilityTick = 1.3 -- Can durability loss per tick
Example Calculation:
10% missing fuel = (10 / 0.50) _ 250ms = 5 seconds total time
Total cost = (10 / 0.50) _ $1.50 = $30
Petrol Can Configuration
Config.petrolCan = {
enabled = true, -- Enable petrol can system
duration = 5000, -- Refuel animation duration (5 seconds)
price = 500, -- Purchase price ($500)
refillPrice = 750 -- Refill existing can price ($750)
}
Note: Police and ambulance workers get petrol cans for free
Fuel Consumption
Config.globalFuelConsumptionRate = 10.0
-- Modifies fuel usage for all vehicles
-- Higher value = faster consumption
-- Uses native SET_FUEL_CONSUMPTION_RATE_MULTIPLIER
Gas Pump Models
Config.pumpModels = {
`prop_gas_pump_old2`,
`prop_gas_pump_1a`,
`prop_vintage_pump`,
`prop_gas_pump_old3`,
`prop_gas_pump_1c`,
`prop_gas_pump_1b`,
`prop_gas_pump_1d`
}
All pump props automatically recognized as refueling points
---
JOB SYSTEM
Free Fuel Jobs
Configured in server.lua:
- police (law enforcement)
- ambulance (EMS/medical services)
Add More Jobs:
local job = xPlayer.getJob().name
if job == "police" or job == "ambulance" or job == "mechanic" then
price = 0 -- Free fuel
end
Payment Processing
- Automatic ESX integration
- ox_inventory money removal
- Insufficient funds notification
- Success/failure feedback
---
FEATURES BREAKDOWN
Station Blips
- Real-time nearest station tracking
- 5-second update intervals
- Configurable visibility modes
- Custom blip sprites and colors
Target System
- ox_target interaction points
- Context menu at pumps
- Vehicle detection
- Can purchase interface
Fuel State Management
- Server-side fuel synchronization
- Entity state system
- Network ID tracking
- Fuel clamping (0-100%)
Petrol Can Features
- WEAPON_PETROLCAN item type
- Metadata durability tracking
- Ammo = durability system
- Slot-based inventory management
- Carry weight validation
Notifications
- ox_lib notify system
- Success messages (green)
- Error messages (red)
- Cost display in descriptions
- Fuel percentage readouts
Security
- DMD-LIB dependency validation
- Resource name verification
- Anti-rename protection
- Automatic shutdown on tampering
---
LOCALIZATION
Supported Languages
- English (en)
- Add more in locales/ folder
Available Locale Strings
- fuel_success: "Refueled to {0}% for ${1}"
- fuel_success_free: "Refueled to {0}% (Free for {job})"
- not_enough_money: "Insufficient funds (need ${0} more)"
- petrolcan_buy: "Purchased petrol can for ${0}"
- petrolcan_refill: "Refilled petrol can for ${0}"
- petrolcan_cannot_carry: "Inventory full, cannot carry petrol can"
- security_validated: "DMD Security: All checks passed"
Adding Custom Language
1. Create locales/yourlang.json
2. Copy English structure
3. Translate strings
4. Players auto-select based on F8 language setting
---
INSTALLATION
Requirements
- FiveM Server (latest build)
- ESX Framework (es_extended)
- ox_lib (v3.22.0 or higher)
- ox_inventory (v2.30.0 or higher)
- dmd-lib (DMD security system)
Installation Steps
1. Ensure dependencies are installed and started:
ensure ox_lib
ensure ox_inventory
ensure es_extended
ensure dmd-lib
2. Extract "dmd-ox-fuel-job" to resources folder:
resources/[newdmd]/dmd-ox-fuel-job/
3. Resource must be named exactly "dmd-ox_fuel":
Rename folder if extracted differently
4. Add to server.cfg AFTER dependencies:
ensure dmd-ox-fuel-job
5. Configure config.lua to your preferences
6. Add gas stations in data/stations.lua (optional)
7. Restart server
---
GAS STATION LOCATIONS
Edit data/stations.lua to add custom locations:
return {
vector3(49.4187, 2778.793, 58.043),
vector3(263.894, 2606.463, 44.983),
vector3(1039.958, 2671.134, 39.550),
-- Add more coordinates here
}
Finding Coordinates
- Stand at desired location
- Open F8 console
- Type: /getcoords (if supported)
- Or use: GetEntityCoords(PlayerPedId())
- Copy vector3 result
Blip Customization
Edit client scripts to modify:
- Blip sprite
- Blip color
- Blip scale
- Blip label text
---
EXPORTS
None Currently
System is self-contained with no external exports
Potential Custom Exports (Add to server.lua):
exports('getFuelPrice', function()
return config.priceTick
end)
exports('setPetrolCanPrice', function(price)
config.petrolCan.price = price
end)
---
COMPATIBILITY
- Frameworks: ESX (required), QBCore (with modifications)
- Inventories: ox_inventory (required)
- Target Systems: ox_target, qb-target (configurable)
- Fuel Systems: Based on ox_fuel, replaces default ox_fuel
Conflicts
- Do NOT run alongside original ox_fuel
- Ensure only one fuel system active
- Remove conflicting fuel scripts
Other Compatible Scripts
- Job management systems
- Vehicle ownership scripts
- Economy/banking systems
- Garage scripts
---
TROUBLESHOOTING
Fuel Not Working
- Verify ox_lib and ox_inventory are started
- Check server console for dependency errors
- Ensure resource named "dmd-ox_fuel" exactly
- Restart all related resources in correct order
Job Detection Issues
- Confirm ESX is fully loaded before script
- Check player job with: /job command
- Verify job names match exactly (case-sensitive)
-- "police" not "Police"
Payment Not Processing
- Check ox_inventory money system
- Verify player has "money" item
- Test with /giveitem [id] money [amount]
- Check server console for payment errors
Petrol Can Problems
- Ensure WEAPON_PETROLCAN exists in ox_inventory items
- Check weapon metadata support enabled
- Verify durability system active
- Test inventory weight limits
Gas Station Blips Not Showing
- Check Config.showBlips value (0/1/2)
- Verify stations exist in data/stations.lua
- Increase update interval if performance issues
- Check player distance to stations
---
PERFORMANCE
- Resmon: ~0.01ms idle, ~0.03ms refueling
- Memory: ~0.5MB
- Threads: Optimized intervals (250ms refuel, 5000ms blips)
- Network: Minimal (state sync only)
- Database: None (ox_inventory handles storage)
Optimization Tips
- Increase Config.refillTick for better performance (500ms)
- Reduce Config.showBlips updates (decrease frequency)
- Limit active gas station count
- Use ox_target for interaction (reduces range checks)
---
SECURITY
DMD-LIB Protection
- Resource name verification
- Dependency validation
- Automatic shutdown on tampering
- Anti-leak measures
Escrow Protected Files
All files except:
- config.lua
- data/stations.lua
- locales/\*.json
Open Files Purpose
- config.lua: Server customization
- stations.lua: Location management
- locales: Translation support
---
FAQ
Q: Can I add more jobs with free fuel?
A: Yes, edit server.lua and add job names to the conditional check
Q: Does this work with QBCore?
A: Requires ESX conversion - replace ESX calls with QBCore equivalents
Q: Can I change fuel prices?
A: Yes, edit Config.priceTick in config.lua
Q: How do I disable petrol cans?
A: Set Config.petrolCan.enabled = false in config
Q: Can players refuel other players' vehicles?
A: No, only vehicle owner/driver can refuel
Q: Does this support electric vehicles?
A: No, designed for fuel-based vehicles only
---
UPDATES
Check for latest version:
- DMD Store website
- Discord announcements
- GitHub releases (if applicable)
Config.versionCheck = true automatically notifies of new versions
---
DMD Store - Professional FiveM Resources