Exports & API
legends_tax is designed to work as a self-contained system with configuration through the admin panel and config files.
Commands
Player Commands
| Command | Description |
|---|---|
/taxui | Open the tax invoice viewer to see pending and paid taxes |
/taxclose | Close any open tax UI |
/taxhousing | Display the detected housing system (admin only) |
Admin Commands
| Command | Permission | Description |
|---|---|---|
/taxadmin | Admin | Open the admin configuration panel |
Admin access is controlled through permissions.lua. See Installation for permission setup.
Configuration Files
config.json
The main configuration file controls all tax settings. This file can be edited directly or through the in-game admin panel.
Structure:
{
"general": {
"useCustomNotifications": true,
"enableDebug": false,
"enableVehicleTax": true,
"enableBankTax": true,
"enableHouseTax": false,
"playerInteractionMode": "npc",
"enableInactivePlayerBypass": false,
"inactivePlayerDays": 30
},
"bankTax": {
"bankTaxRate": 0.05,
"minBankBalanceForTax": 10000,
"maxBankBalanceForTax": 1000000
},
"vehicleTax": {
"baseVehicleTaxRate": 0.02,
"extraVehicleTaxRate": 0.02,
"maxVehicleTaxRate": 0.10
},
"taxIntervals": {
"useGlobalInterval": false,
"globalTaxIntervalDays": 7,
"vehicleTaxIntervalDays": 7,
"bankTaxIntervalDays": 3
},
"jobDiscounts": {
"police": 15,
"ambulance": 10
}
}See Configuration for detailed explanation of all options.
permissions.lua
Controls admin access to the tax panel.
-- Permission Modes
Permissions.UseAcePermissions = true -- Use FiveM ACE system
Permissions.UseWhitelist = true -- Use identifier whitelist
Permissions.RequireBoth = false -- Require one or both
-- ACE Permission
Permissions.AcePermission = "tax.admin"
-- Whitelist (supports multiple identifier types)
Permissions.Whitelist = {
"steam:11000010000000",
"discord:123456789012345678",
"license:abcdef1234567890...",
}
-- Discord Webhook for admin logging
Permissions.UseDiscordLogging = true
Permissions.DiscordWebhook = "https://discord.com/api/webhooks/..."NPC Configuration
Configure the tax office NPC in config.json:
"npc": {
"model": "a_m_y_business_01",
"coords": { "x": 216.19, "y": -808.77, "z": 30.74 },
"heading": 90.0,
"label": "Tax Office",
"icon": "fa-solid fa-money-bill-wave",
"useOxTarget": true
}Admin Panel Features
The in-game admin panel (/taxadmin) provides:
Dashboard
- Total revenue statistics
- Pending tax amounts
- Overdue invoices
- Tax distribution charts
- Player compliance overview
Configuration
- Modify all tax rates
- Adjust intervals
- Configure job discounts
- Enable/disable tax types
- Toggle player interaction mode (NPC or command)
- Configure inactive player bypass and threshold
- Testing mode controls
Player Management
- View all players with pending taxes
- Search players by name/ID
- View player invoice history
- Manage exemptions (permanent or time-limited with expiry in days)
Audit Logs
- View admin actions
- Filter by action type
- Search logs
- Discord webhook integration
Integration Tips
Adding Job Discounts
Edit config.json or use the admin panel:
"jobDiscounts": {
"police": 15, -- 15% discount
"ambulance": 10, -- 10% discount
"mechanic": 5, -- 5% discount
"taxi": 5 -- 5% discount
}Custom NPC Location
Move the tax NPC by editing config.json:
"npc": {
"coords": { "x": 100.0, "y": 200.0, "z": 30.0 },
"heading": 180.0
}Restart the resource after changing NPC location.
Testing Mode
For development and testing, enable testing mode to use seconds instead of days:
"testing": {
"testingMode": true,
"testingGlobalIntervalSeconds": 10,
"testingBankTaxIntervalSeconds": 5
}Never enable testing mode in production! Tax cycles will run every few seconds instead of days.
Database
The resource automatically creates and manages these tables:
| Table | Purpose |
|---|---|
player_tax_data | Player tax timestamps and last seen tracking |
tax_invoices | All invoices (pending/paid) |
tax_audit_logs | Admin action logs |
tax_exemptions | Exempt players (with optional expiry) |
tax_statistics | Aggregated stats |
Tables are created automatically on first start. No manual SQL import required.
Framework Support
The resource automatically detects and supports:
| Framework | Support |
|---|---|
| QBox (qbx_core) | Full support |
| QB-Core | Full support |
| ESX | Full support |
Framework detection order: QBox → QB-Core → ESX
Need Help?
Join our Discord for support: discord.gg/lgnds (opens in a new tab)