Exports & API

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

CommandDescription
/taxuiOpen the tax invoice viewer to see pending and paid taxes
/taxcloseClose any open tax UI

Admin Commands

CommandPermissionDescription
/taxadminAdminOpen 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
    },
    "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
  • Testing mode controls

Player Management

  • View all players with pending taxes
  • Search players by name/ID
  • View player invoice history
  • Manage exemptions

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:

TablePurpose
player_tax_dataPlayer tax timestamps
tax_invoicesAll invoices (pending/paid)
tax_audit_logsAdmin action logs
tax_exemptionsExempt players
tax_statisticsAggregated stats

Tables are created automatically on first start. No manual SQL import required.


Framework Support

The resource automatically detects and supports:

FrameworkSupport
QBox (qbx_core)Full support
QB-CoreFull support
ESXFull support

Framework detection order: QBox → QB-Core → ESX

Need Help?

Join our Discord for support: discord.gg/lgnds (opens in a new tab)


Legends Store - Premium FiveM Scripts