Customization

Extend nox-taxi with custom integrations using the provided hook functions.

Overview

nox-taxi provides editable utility files for easy integration with your server's systems:

  • client/client_utils.lua - Client-side hooks
  • server/server_utils.lua - Server-side hooks

These files are not encrypted and can be freely modified.

Client Hooks

ReportIllegalSurcharge

Called when a player reports illegal surcharge abuse.

function ClientUtils.ReportIllegalSurcharge(data)
    -- data.plate: Vehicle plate
    -- data.coords: Location coordinates
    -- data.vehicleModel: Vehicle model name
end

Default integrations:

  • nox-carcontrol dispatch
  • ps-dispatch
  • cd_dispatch
  • qs-dispatch

Example - Custom dispatch:

function ClientUtils.ReportIllegalSurcharge(data)
    TriggerServerEvent('your-dispatch:create', {
        type = 'taxi_fraud',
        coords = data.coords,
        vehicle = data.plate,
    })
end

ShowNotification

Display notifications to the player.

function ClientUtils.ShowNotification(message, type, duration)
    -- type: 'success', 'error', 'primary', 'warning'
    -- duration: milliseconds
end

Example - ox_lib:

function ClientUtils.ShowNotification(message, type, duration)
    lib.notify({
        title = 'Taxi',
        description = message,
        type = type,
        duration = duration or 5000
    })
end

Example - okokNotify:

function ClientUtils.ShowNotification(message, type, duration)
    exports['okokNotify']:Alert('Taxi', message, duration or 5000, type)
end

ShowTextUI / HideTextUI

Display and hide text UI prompts.

function ClientUtils.ShowTextUI(message, position)
    -- position: 'left', 'right', 'top'
end

function ClientUtils.HideTextUI()
end

Example - ox_lib:

function ClientUtils.ShowTextUI(message, position)
    lib.showTextUI(message, {
        position = position or 'left-center'
    })
end

function ClientUtils.HideTextUI()
    lib.hideTextUI()
end

OnMissionStarted

Called when an NPC mission begins.

function ClientUtils.OnMissionStarted(data)
    -- data.pickupCoords: Pickup location
    -- data.dropoffCoords: Destination
    -- data.passenger: NPC ped handle
end

Example - Custom mission banner:

function ClientUtils.OnMissionStarted(data)
    exports['your-ui']:ShowMissionBanner('Taxi Mission Started')
end

OnMissionCompleted

Called when an NPC mission ends.

function ClientUtils.OnMissionCompleted(data)
    -- data.success: boolean
    -- data.fare: Final fare amount
    -- data.tip: Tip amount (if any)
    -- data.reason: Completion reason
end

Example - Stats tracking:

function ClientUtils.OnMissionCompleted(data)
    if data.success then
        exports['your-stats']:IncrementStat('taxi_completed')
    end
end

OnPassengerPickedUp

Called when a passenger enters the taxi.

function ClientUtils.OnPassengerPickedUp(data)
    -- data.passenger: NPC ped handle
    -- data.destination: Destination name
end

OnPassengerDroppedOff

Called when a passenger exits the taxi.

function ClientUtils.OnPassengerDroppedOff(data)
    -- data.passenger: NPC ped handle
    -- data.fare: Fare amount
    -- data.tip: Tip amount
end

Server Hooks

ProcessPayment

Custom payment processing.

function ServerUtils.ProcessPayment(playerId, amount, paymentType)
    -- payerId: Player source
    -- amount: Payment amount
    -- paymentType: 'fare', 'tip', etc.
    -- return: boolean success
end

Example - Custom economy:

function ServerUtils.ProcessPayment(playerId, amount, paymentType)
    local success = exports['your-economy']:AddMoney(playerId, 'cash', amount)
    return success
end

GiveRewardItem

Give reward items to players.

function ServerUtils.GiveRewardItem(playerId, itemName, amount)
    -- Default uses qb-inventory
end

Example - ox_inventory:

function ServerUtils.GiveRewardItem(playerId, itemName, amount)
    exports['ox_inventory']:AddItem(playerId, itemName, amount)
end

LogTransaction

Log taxi transactions for admin review.

function ServerUtils.LogTransaction(type, driverId, passengerId, amount)
    -- type: 'fare', 'tip', 'flee'
end

Example - Discord webhook:

function ServerUtils.LogTransaction(type, driverId, passengerId, amount)
    TriggerEvent('your-webhook:send', {
        title = 'Taxi Transaction',
        description = string.format('%s: $%d from %s to %s', 
            type, amount, passengerId, driverId)
    })
end

TrackMissionStats

Track mission completion statistics.

function ServerUtils.TrackMissionStats(playerId, missionData)
    -- missionData.success: boolean
    -- missionData.fare: Fare earned
    -- missionData.distance: Distance traveled
    -- missionData.time: Duration
end

Adding Custom Taxi Vehicles

To add your own taxi models, edit shared/config.lua:

Config.TaxiVehicleNames = {
    "taxi",
    "yourtaxi1",
    "yourtaxi2",
}

Adding Pickup/Dropoff Locations

Add coordinates to shared/config.lua:

Config.NpcPickupLocations = {
    vector4(x, y, z, heading),
    -- Add more...
}

Config.NpcDropoffLocations = {
    vector4(x, y, z, heading),
    -- Add more...
}

Use a coordinate tool to find exact positions in-game

Language Customization

Edit lang/en.lua or lang/en.json to customize text:

-- lang/en.lua
return {
    ['taximeter.title'] = 'Taxi Meter',
    ['taximeter.fare'] = 'Current Fare',
    ['taximeter.start'] = 'Start Meter',
    ['taximeter.stop'] = 'Stop Meter',
    -- Add more...
}

Last updated: January 28, 2026

Last updated 1 month ago