ScriptsM Trains

ScriptsM Trains

This script returns trains to the game, you can buy tickets, ride around the city with your friends on the subway, or get on a freight train and drive to the Blaine County. Working for ESX, QB or custom framework

Installation

Download a resource (opens in a new tab) from keymaster or buy it by buttons at the top

Install optional dependencies.

These resources aren't required but provide additional functionality.

Resource start order

It's important for your resources to start in a logical order to prevent errors from missing dependencies.

start es_extended / qb-core
start ox_lib -- if you are using ox_target
start qb-target
start QBScriptsM-Trains / ESScriptsM-Trains

Config

There you can find an config of resource with description for all params

Config = {}
Config.MachineLocations = { -- Custom ticket buy machine locations
    { coords = vector3(-213.1, -1036.19, 30.14) },
    { coords = vector3(-215.35, -1035.39, 30.14) },
    { coords = vector3(113.38, -1725.65, 30.11) },
    { coords = vector3(114.99, -1723.91, 30.11) },
    { coords = vector3(-214.1, -1031.9, 30.14) },
    { coords = vector3(-211.9, -1032.71, 30.14) },
    { coords = vector3(116.19, -1728.06, 30.11) },
    { coords = vector3(117.87, -1726.25, 30.11) },
    { coords = vector3(277, -1205.6, 38.89) },
    { coords = vector3(281.99, -1205.55, 38.9) },
    { coords = vector3(298.93, -1205.55, 38.89) },
    { coords = vector3(-540.37, -1285.05, 26.9) },
    { coords = vector3(-538.87, -1281.64, 26.9) },
    { coords = vector3(-541.19, -1280.56, 26.9) },
    { coords = vector3(-542.66, -1284, 26.9) },
    { coords = vector3(277, -1203, 39) },
    { coords = vector3(282, -1203, 39) },
    { coords = vector3(299, -1203, 39) },
}
 
Config.DisableMetro = false -- Disable metro trains spawning
Config.DisableFreightTrain = false -- Disable freight trains spawning
Config.UseCommand = true -- Set this to false if you don't wanna use command to disable trains.
Config.SpawnFreq = 120000 -- Set spawn frequency, default gta is 120000
Config.BuyKey = 51 -- Change key for buy ticket, https://docs.fivem.net/docs/game-references/controls/
Config.BuyText = "Buy Ticket for 1$ : ~INPUT_PICKUP~" -- Change it to your buy ticket text, you can find controls here - https://docs.fivem.net/docs/game-references/controls/
Config.CompanyName = 'Los Santos Transit' -- Set your company name for notifications
 
Config.UseNotify = true -- Show notifications or not
Config.BuyNotifyIcon = 'CHAR_LS_TOURIST_BOARD' -- Set your icon for notifications
Config.BuyNotifyText = 'Thank you for riding Los Santos Transit, your ticket will be valid only for one ride on metro.' -- Set your text for notifications.
Config.BuyNotifyColor = 2 -- You can find all colors here - https://docs.fivem.net/docs/game-references/hud-colors/
 
Config.NotEnoughtMoneyNotifyIcon = 'CHAR_LS_TOURIST_BOARD' -- Set your icon for notifications
Config.NotEnoughtMoneyNotifyText = 'You have not enough money to buy ticket.' -- Set your text for notifications.
Config.NotEnoughtMoneyNotifyColor = 2 -- You can find all colors here - https://docs.fivem.net/docs/game-references/hud-colors/
 
Config.UseQB = true -- Use QB Core or no?
Config.TicketPrice = 1 -- Ticket price 
 
Config.EnableBlips = true -- Enable or disable metro blips
Config.ShowBlipsAlways = true -- Show blips if you don't buy ticket
Config.BlipName = "Metro" -- Blip name
Config.BlipSprite = 795 -- Blip sprite: https://docs.fivem.net/docs/game-references/blips/
 
Config.UseQbTarget = false -- Use qb target
Config.UseOxTarget = false -- Use qb target
Config.TargetText = 'Buy ticket for 1$' -- Target button text
Config.UseNextStation = true -- Use next station notify or not
 
Config.UseCustomNotify = false -- Use custom buy notifications
Config.CustomBoughtTicketNotification = function()
exports['t-notify']:Custom({
    style = 'message',
    title = 'Purchase',
    sound = true,
    message = 'You bought ticket for 1$',
    duration = 5500
})
end
 
Config.CustomNotEnoughtMoneyNotification = function() -- 
exports['t-notify']:Custom({
    style = 'message',
    title = 'Purchase',
    sound = true,
    message = 'You bought ticket for 1$',
    duration = 5500
})
end