Taxi Script Overview
This script provides a fully functional taxi service for your FiveM server using the ESX or QBCore framework. It integrates seamlessly with popular notification systems like vms_notifyv2 and okokNotify while supporting multi-language locales for maximum flexibility. Here's how the script works:
PREVIEW
Features
NPC Taxi Interaction
- Players can approach designated NPCs at specific locations to call a taxi.
- The script uses
ox_targetto interact with NPCs.
Taxi Cooldown
- Players must wait for a configurable cooldown period (
Config.TaxiCooldown) before calling another taxi. - If a player exits the taxi or the taxi is deleted, they can call another taxi once the cooldown ends.
- Players must wait for a configurable cooldown period (
Custom Notification System
- Supports
vms_notifyv2,okokNotify, and default ESX/QBCore notifications. - Notifications provide feedback on taxi calls, arrival, and destination selection.
- Supports
Localization Support
- Multi-language support is available, with predefined translations in Czech (
cz) and English (en). - Easily configurable via
Config.Locale.
- Multi-language support is available, with predefined translations in Czech (
Dynamic NPC Locations
- NPCs are spawned at specific coordinates defined in
Config.NPCLocations. - Each NPC is associated with its own taxi spawn and arrival locations.
- NPCs are spawned at specific coordinates defined in
Destination Options
- Players can select from predefined destinations defined in
Config.DestinationLocations. - Taxi fares are customizable for each NPC and destination through
Config.TaxiPrices.
- Players can select from predefined destinations defined in
Menu System
- Uses
ox_libto display a modern, dynamic menu for destination selection. - Options are dynamically populated based on the player's chosen NPC.
- Uses
Escrow-Ready
- The script is compatible with FiveM’s escrow system to protect sensitive logic while keeping configuration and locale files open for customization.
How It Works
Calling a Taxi
- Players approach an NPC and press the interaction key (
Eforox_target). - If the cooldown period has elapsed, a taxi is spawned and driven to the player.
- Players approach an NPC and press the interaction key (
Boarding the Taxi
- Once the taxi arrives, players enter the vehicle as a passenger.
- A menu with destination options is displayed for the player to select their desired location.
Taxi Ride
- After selecting a destination, the fare is deducted from the player's money.
- The driver automatically navigates to the chosen location.
Ending the Ride
- Upon arrival, the player is notified that they have reached their destination.
- The taxi despawns shortly after the player exits, and the cooldown is reset.
Configuration
Framework:
SetConfig.Frameworkto eitherESXorQBCoredepending on your server.Notification System:
ConfigureConfig.NotificationSystemto usevms_notifyv2,okokNotify, ordefault.Cooldown:
Define the cooldown period in milliseconds inConfig.TaxiCooldown.NPC Locations:
Add or modify NPC locations inConfig.NPCLocations, including their spawn, arrival, and departure locations.Destination Options:
Define available destinations and fares inConfig.DestinationLocationsandConfig.TaxiPrices.
Requirements
- Framework: ESX or QBCore
- Target System: ox_target
- Menu System: ox_lib
- Notification System: vms_notifyv2, okokNotify, or default
This script enhances roleplay by providing a realistic and user-friendly taxi system, fully integrated into your FiveM server's framework.