βοΈIntegration
Information about how to integrate our taxi system with your server's resources.
rahe-taxi has auto-detection for the most common fuel, vehicle key and garage resources. If you are running one of the supported systems, no setup is required β it just works.
If you use a custom or unsupported resource, you can plug it in by editing the corresponding file under public/api/. These files are unencrypted so you can adapt them to your systems.
The detection runs in a
CreateThreadat resource start and picks the first matching resource (byGetResourceState). If none match, an error is printed and you must implement the integration yourself.
Fuel system
File: public/api/cl_fuelsystem.lua (client-side)
Supported out of the box
LegacyFuelqs-fuelstationsox_fuelcdn-fuellc_fuel
Function to implement
function setVehicleFuel(vehicle, fuel)
-- vehicle: entity handle (client-side)
-- fuel: number 0-100
endThis is called when an NPC taxi vehicle is spawned and needs its fuel level set.
Adding your own fuel system
Add a new elseif branch in the detection thread, then add a matching branch in setVehicleFuel:
If everything else fails, the script falls back to the native SetVehicleFuelLevel.
Vehicle keys system
File: public/api/sv_vehiclekeys.lua (server-side)
Supported out of the box
qbx_vehiclekeysqs-vehiclekeyscd_garagewasabi_carlockRenewed-Vehiclekeysqb-vehiclekeys
Function to implement
Called when a passenger gets into an NPC driver's taxi so the doors can be unlocked for them.
Adding your own keys system
The fallback unlocks the vehicle via the native SetVehicleDoorsLocked(vehicle, 1).
Garage system
File: public/api/sv_garagesystem.lua (server-side)
Supported out of the box
qbx_vehiclesqb-garagesesx_garage
Function to implement
Each entry returned must have this shape:
This is used by drivers to choose which of their owned vehicles to put on duty.
Vehicle naming
Display names come from the VEHICLES config (shared/vehicles.lua). If a model is not present there, an error is logged and the vehicle is skipped (qb/qbx) or returned with the raw model name (esx). Add your custom vehicles to that config to fix this.
Adding your own garage system
Add detection and a query branch. Example for a custom MySQL-backed garage:
Dispatch system
File: public/api/cl_dispatch.lua (client-side)
Used by the in-app safety report feature. When a rider or driver sends a safety report from the UI, the script forwards it to your dispatch / police-alert resource.
Supported out of the box
ps-dispatchcd_dispatchqs-dispatchqb-policejob(defaultpolice:server:policeAlertevent)
Function to implement
The localized text is built from RiderSafetyReport / DriverSafetyReport in the locale files. The current player's coordinates can be obtained inside the function via GetEntityCoords(PlayerPedId()).
Adding your own dispatch system
Add detection and a handler branch:
Last updated