[ESX] NPC Taxi System [Paid]

A script by HaZeSh0cK

No reviews yet.
[ESX] NPC Taxi System [Paid] main image

Full Description

In a majority of servers, the role of a taxi driver remains unchosen by players. Our system fills this gap with a realistic NPC taxi driver experience.

Features

  • Instant Taxi Call: Use the /taxi command to immediately summon a taxi to your location. The same command can also cancel the request. (This is adjustable in the config.lua file.)
  • Music on the Go: Enjoy a musical ride with tracks chosen randomly from the links specified in config.lua NEED XSOUND.
  • Transparent Pricing: A built-in taximeter displays the ongoing cost and distance covered during the ride.
  • Payment Flexibility: Once at your destination, opt for your preferred payment mode - cash or bank, through the NUI interface.
  • Customization Galore: From the driving style to the type and model of the cars and drivers, everything is modifiable through config.lua.
  • OneSync Integration: The system is fully compatible with OneSync.
  • Discord Logs: Get all the crucial logs directly in your Discord.
  • Alerts and Notifications: All system messages and notifications can be modified in the config.lua file…

Config.lua

Config = {}

-- ** ESX SETTINGS **
Config.UseNewESX = true

-- ** TAXI SETTINGS **

-- Command & Interactions
Config.Command = "taxi"
Config.KeyEnterTaxi = 51  -- 'E' key

-- Taxi Spawn Configurations
Config.SpawnDistance = 250.0
Config.VehicleModels = {'taxi', 'sultan'}
Config.NPCModels  = {'a_f_m_beach_01', 'a_f_m_salton_01', 'a_m_m_acult_01'}

-- Taxi Behavior & Characteristics
Config.TaxiUndestroyable = true
Config.UseCustomPlate = true
Config.PlateText = "Taxi"
Config.DriverAbility = 1.0
Config.DriverAggressiveness = 0.0
Config.DrivingStyle = 537395647  -- See: https://vespura.com/fivem/drivingstyle/
Config.CruiseSpeed = 20.0

-- Taxi Pricing
Config.BaseFare = 10
Config.PricePerKM = 5

-- Taxi Blip Settings
Config.EnableBlip = true
Config.BlipSprite = 198   -- Taxi icon
Config.BlipColour = 5     -- Yellow
Config.BlipName = "Taxi"  -- Name of the Blip

-- ** PLAYER NOTIFICATIONS **
Config.Messages = {
    TaxiOnTheWay = "A taxi is en route to your location!",
    TaxiArrived = "Your taxi has arrived!",
    InTaxiPrompt = "You are inside the taxi. Set a destination on the map.",
    DrivingToDestination = "The taxi is heading to your marked destination.",
    TaxiCancelled = "Taxi service cancelled.",
    ExitTaxi = "You can exit the taxi only when it is stationary.",
    PressInfo = "Press [E] to board the taxi.",
    CouldNotPay = "Payment for the taxi failed. Try a different payment method.",
    TaxiPayed = "You have payed for traveling with the taxi"
}

Config.NotificationFunction = function(msg)
    ESX.ShowNotification(msg)  -- Replace with your notification function
end

-- ** DISCORD LOG SETTINGS **
Config.DiscordLogs = false
Config.DiscordWebhook = "YOUR_DISCORD_WEBHOOK_URL"
Config.DiscordMessages = {
    calledTaxi = "**Player {playerName}** requested a taxi to **X:{x}, Y:{y}, Z:{z}**",
    payedTaxi = "**Player {playerName}** paid {amount} for a {km} km taxi ride"
}

-- ** ADDITIONAL SETTINGS **

-- In-game UI
Config.UsePin = true  -- Set this only to true if you have a pincode column in your user database

-- Background Music during Taxi Rides
Config.UseXSound = true
Config.MusicUrls = {
    url_1 = {url = "https://www.youtube.com/watch?v=6jJIVK-daGk&list=RDQMcwFUtiNtD6U&start_radio=1", duration = 1.1 * 60000},
    url_2 = {url = "https://www.youtube.com/watch?v=1nCqRmx3Dnw&list=RDQMcwFUtiNtD6U&index=2", duration = 2.18 * 60000},
    url_3 = {url = "https://www.youtube.com/watch?v=lT2T49yP2ew&list=RDQMcwFUtiNtD6U&index=3", duration = 1.36 * 60000},
    url_4 = {url = "https://www.youtube.com/watch?v=i8ITGzgccn0", duration = 2.15 * 60000},
    url_5 = {url = "https://www.youtube.com/watch?v=To4SWGZkEPk&list=PL3-sRm8xAzY999ARkg8XztLMO-IikrsQw", duration = 2.34 * 60000},
}
Config.MusicVolume = 0.2
Config.HearingDistance = 2

Screenshots:



:eyes: Youtube
:shopping_cart: Purchase

Code is accessible: No, only config and nui files
Subscription-based: No
Lines (approximately): 500
Requirements: es_extended, for music during ride is xsound needed
Support: Yes

Config Merger
Have you tried Config Merger? Merge your configs easily