Skip to main content

Train Script

Train script

Info

Trailer
Showcase
BUY HERE

General benefits and script support

Dependencies & Installation

  • Install the script on the menu
  • Put the script in the server and add ensure "script_name" to server.cfg
  • enjoy...

Config demo

Open Config
config.lua

Config = {}

Config.Debug = {
print = false,
control = false,
cancel = false,
}

-- If "DEBUG" control and cancel is enabled, the overheat train
-- option is disabled and you can
-- use the up arrow keys to select maximum speed and
-- use the down arrow key to instantly stop again.
-- and the boiler can't overheat

Config.Server = {
Language = 'en', -- the language that is used in Config.Texts
NotifCustom = false, -- if you want to use custom notifications in client_open.lua
CustomFramework = false, -- if the framework doesn't load correctly it can be set here manually
AutoInsertSQL = true, -- the database should be set automatically
MetaTarget = false, -- Use prompt (false) or target (true)
}

Config.job = {
name = 'unemployed', -- a job that will have access to the faction (if set to " = false" any job can do the job)
bossGrade = 0, -- Grade that will have access to refining and management reporting. (It is one rank higher, so if you set this number to 3 and the job also has rank 4, both will have access.)
managmentSystem = true,
-- if you want the trains to work without shopping and just spawn, all boss functions will also be moved so that anyone who has a job can do them

-- The following is disabled.
-- - buying/selling trains
-- - train upgrades (all in the base)
-- - the ability to rename the train

-- change
-- - Trains spawn straight away without having to deal with whether it is in the world or not

}

Config.HUD = {
trainHudScale = 70, -- % hud size
trainHUDposition = 'bottom-middle', -- bottom-middle / bottom-left / bottom-right / middle-right / top-right / top-left / top-middle / left-middle
opacity = 1.0, -- Opacity train HUD
menuPos = 'top-right', -- menu location
}

-- list of keys here: https://github.com/mja00/redm-shit/blob/master/nuiweaponspawner/config.lua

Config.Prompt = {
menu = 0xE30CD707, -- R
sit = 0xF3830D8E, -- J
boiler = 0xE30CD707, -- R
timetable = 0xE30CD707, -- R
editTimetable = 0xF3830D8E, -- J
submitTelegram = 0xE30CD707, -- R
openStash = 0xE30CD707, -- R
wagonBox = 0xF3830D8E, -- J
grabBox = 0xE30CD707, -- R
leftSwitch = 0xA65EBAB4, -- Left Arrow
rightSwitch = 0xDEB34313, -- Right Arrow
lockSpeed = 0xE30CD707, -- R
relight = 0xD9D0E1C0, -- Space

}

Config.Economics = {
pricePerTow = 20, -- $ -- The cost to retrieve the train from impound. Set to false to disable this feature.
percentageSale = 60, -- % -- The percentage of the purchase price refunded to the player when they sell the train (including upgrades).
coalThrowingTime = {30,60}, -- s -- The interval (in seconds) for how often coal needs to be thrown into the furnace.
coalForThrowing = {1,5}, -- pcs -- The approximate amount of coal consumed per throw (in pieces).
percentOverheat = 90, -- % -- The percentage of maximum speed at which the engine begins to overheat.
overheatingLogic = 'low', -- 'low' / 'medium' / 'high' -- The tolerance for overheating: 'low' (low tolerance), 'medium' (medium tolerance), or 'high' (high tolerance).
}

Config.WorldLore = {
year = '1899', -- the year in which you
SpeedUnitsMPH = true, -- KM/H or MPH
currencySymbol = '$', -- emblems of currency
}

Config.Sitting = true -- if you want the script to replace the logic of sitting on the train
Config.PermissionDrive = true -- leave "true" if you want to prevent any person without a job from driving the train
Config.StashLockOnJob = true -- if can stash open only job

Config.Item = {
fuel = 'coal', -- name of item for train fuel
cooling = 'water', -- the name on the item to cooling, if you put "false" the item will not be required
}

-- it is always necessary to write what the upgrade does from the original train (the upgrade is not multiplied)
Config.Upgrade = {
[1] = {
stash = {maxweight = 100000, slots = 5}, -- for REDEMRP_reboot is determined only by the maxweight // for VORP it is determined only by the slots
overheatingIncrease = false,
speedIncrease = false,
price = 100 -- upgrade price
},
[2] = {
stash = {maxweight = 200000, slots = 20},
overheatingIncrease = false,
speedIncrease = 10,
percentPrice = 10, -- % percentage of the original train price
},
[3] = {
stash = {maxweight = 300000, slots = 10},
overheatingIncrease = 10, -- % // how much the chances of overheating are reduced
speedIncrease = 20, -- MPH / Km/h
percentPrice = 10,
},
[4] = {
stash = {maxweight = 200000, slots = 20},
overheatingIncrease = 10,
speedIncrease = 30,
percentPrice = 20,
},
}

Config.Train = {
[1] = {
label = 'Locomotive', -- model name
model = 0x3260CE89, -- model hash
maxSpeed = 67, -- the maximum speed is 108 KM and 67 MPH
stash = {maxweight = 500000, slots = 2}, -- for REDEMRP_reboot is determined only by the maxweight // for VORP it is determined only by the slots
price = 50, -- price
},
[2] = {
label = 'SAE train',
model = 0x3D72571D,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[3] = {
label = 'Lannahechee train',
model = 0x0392C83A,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[4] = {
label = 'CUR train',
model = 0x4C9CCB22,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[5] = {
label = 'Special train',
model = 519580241,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[6] = {
label = 'Coal train',
model = 214708080,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[7] = {
label = 'Armored train',
model = 218350989,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[8] = {
label = 'Bayou train',
model = 0x5AA369CA,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[9] = {
label = 'Cornwall',
model = 0x487B2BE7,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[10] = {
label = 'Pacific Union',
model = 0xDA2EDE2F,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
[11] = {
label = 'SAE Travel Train',
model = 0x3ADC4DA9,
maxSpeed = 30,
stash = {maxweight = 100000, slots = 5},
price = 200,
},
}

Config.Handcar = true -- if you want to see the handcard in the menu

Config.editTimetable = true -- possibility to edit all boards in management

Config.Managment = { -- if you set false, disable this option -- Config.Managment = false
[1] = vector4(2378.6082, -1465.9146, 46.0712, 250.0734),
}

Config.allTimetable = { -- if you set false, disable this option -- Config.allTimetable = false
[1] = vector4(2692.5627, -1453.5532, 46.2691, 24.9977),
}

Config.Work = { -- if you put -Config.Work = false- you disable the option to do import
BoxMaxNumber = 9, -- how many boxes are spawned
paymentForBox = false, -- payment after delivery of each box
distanceMultiplier = 1.1, -- 1.0. is off // price increase according to distance / If money (money = {0.1,0.2},) is less than 1, make it less than 1 and vice versa.
forBossMoney = 0.5, -- the money the player receives from the contract \* forBossMoney = is added to the boss menu
}

Config.TrainStations = {
Valentine = {
PosName = "Valentine",
Model = "U_M_M_RhdTrainStationWorker_01",
Pos = vector4(-163.2767, 638.3493, 114.0909,149.3567),
blip = {bliphash = -250506368, name = 'Train Station'}, -- if you want to disable blip, set 0 or false // other possible blips can be found here: (( https://github.com/femga/rdr3_discoveries/tree/22fa3103a803fb1a70feb61137ae08db3b09c192/useful_info_from_rpfs/textures/blips ))
SellPoint = {
money = {1,5}, -- minimum/maximum for base price + distance is added
coords = vector3(-174.9261, 626.3090, 114.0321),
spawnBox = vector4(-167.4731, 631.2678, 114.0821, 117.0369),
},
timetable = vector4(-178.5973, 623.1332, 114.0321, 40.5996) -- If false vypnuto
},
Saint_Denise = {
PosName = "Saint Denise",
Model = "U_M_M_RhdTrainStationWorker_01",
Pos = vector4(2734.3938, -1438.6351, 46.1782, 192.0867),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(2712.1125, -1449.0399, 46.2531),
spawnBox = vector4(2721.4529, -1446.0479, 46.2798, 97.9693),
},
timetable = vector4(2690.4521, -1448.9301, 46.2728, 215.4100)
},
Armadillo = {
PosName = "Armadillo",
Model = "u_m_m_blwtrainstationworker_01",
Pos = vector4(-3746.0771, -2596.9485, -13.2609, 166.7392),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(-3734.4517, -2597.3787, -12.9171),
spawnBox = vector4(-3739.3689, -2592.8030, -13.2276, 292.3721),
},
timetable = vector4(-3733.6855, -2605.9827, -12.9317, 293.8493)
},
Anesburg = {
PosName = "Anesburg",
Model = "s_m_m_trainstationworker_01",
Pos = vector4(2955.8801, 1287.0972, 44.6563, 220.9325),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(2939.9321, 1280.5576, 44.6376),
spawnBox = vector4(2949.6519, 1279.9341, 44.6809, 93.8822),
},
timetable = vector4(2930.2139, 1279.9497, 44.6529, 247.6525)
},
Benedict = {
PosName = "Benedict",
Model = "u_m_o_rigtrainstationworker_01",
Pos = vector4(-5230.0562, -3466.9624, -20.5042, 93.4671),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(-5227.5034, -3470.6296, -20.565),
spawnBox = vector4(-5230.0435, -3457.4919, -21.3746, 91.1455),
},
timetable = vector4(-5230.9536, -3470.7217, -20.5644, 269.7726)
},
Rhodes = {
PosName = "Rhodes",
Model = "U_M_M_RhdTrainStationWorker_01",
Pos = vector4(1212.7292, -1292.5000, 76.9095, 229.6887),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(1220.9806, -1286.0581, 76.8995),
spawnBox = vector4(1219.7407, -1298.0535, 76.9489, 230.9606),
},
timetable = vector4(1233.8535, -1293.7489, 76.9034, 312.8377)
},
Wallace = {
PosName = "Wallace",
Model = "U_M_M_RhdTrainStationWorker_01",
Pos = vector4(-1312.0027, 391.8457, 95.3806, 357.4991),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(-1294.2218, 413.7724, 94.9545),
spawnBox = vector4(-1314.4458, 385.1604, 95.5980, 153.9305),
},
timetable = vector4(-1300.7246, 402.8132, 95.3839, 154.6300)
},
McFarlane = {
PosName = "McFarlane",
Model = "U_M_M_RhdTrainStationWorker_01",
Pos = vector4(-2501.9470, -2415.8293, 60.5870, 129.5028),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(-2494.2217, -2424.3801, 60.5994),
spawnBox = vector4(-2502.3276, -2409.6223, 60.2026, 330.1398),
},
timetable = false
},
emerald = {
PosName = "Emerald",
Model = "u_m_o_rigtrainstationworker_01",
Pos = vector4(1525.9584, 447.3514, 90.7307, 247.1653),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(1521.1963, 446.7019, 90.7307),
spawnBox = vector4(1524.0227, 457.1273, 89.8633, 25.4772),
},
timetable = vector4(1519.3899, 441.0817, 90.7307, 276.8301)
},
riggs = {
PosName = "Riggs Station",
Model = "u_m_o_rigtrainstationworker_01",
Pos = vector4(-1099.2311, -578.5135, 82.4543, 323.9911),
blip = {bliphash = -250506368, name = 'Train Station'},
SellPoint = {
money = {1,5},
coords = vector3(-1092.7881, -573.4484, 85.5800),
spawnBox = vector4(-1103.6278, -572.0865, 82.5061, 345.9977),
},
timetable = vector4(-1096.3286, -572.1810, 82.4459, 243.5255)
},

}

Config.Texts = {
['en'] = {
TurnAround = '↪️ Turn Train',
RemoveTrain = '🛖 Park Train',
CancelMenu = '🔴 Cancel Job',
trainList = '🚂 Train List',
towLabel = '⚙️ Towed Trains',
MenuTelegram = '💼 Delivery',
handcar = '🛞 Handcar',

bossMoney = 'Money in cash',
bossMoneyDesc = 'Click to withdraw money',


money = 'Money',
TrainMenuTitle = 'Trains',
SelectTrainDesc = 'Press to Select',
upgrade = 'Upgrade',
sellPrice = 'Selling Price:',
stageZero = 'Stage 0 (No Upgrade)',
activeStage = 'Active',
stage = 'Stage',
noUpgrade = 'Basic state without any upgrade',
managmentTittle = 'Train Management',
manageTimetable = 'Edit Timetables',
manageDesc = 'Press to Select',
stash = 'Stash',
slots = 'Slots',
model = 'Model',
price = 'Price',
speed = 'Speed',
overheatedReducing = 'Overheat Resistance',
timetable = 'Timetables',
renameTrain = 'Rename Train',
sellTrain = 'Sell Train',
buyTrain = 'Buy Train',
upgradeTrain = 'Upgrade Train',
allTimetable = 'All Timetables',
allTimetableDesc = 'Select a station to see the departure board',

notif = {
noMoney = "You don't have enough money",
noBoss = 'You don’t have the required permissions',
renameError = 'You didn’t enter a valid value',
noEmployee = 'What are you doing? I’m not giving you the train',
noTrainFound = 'No train nearby',
workCancel = 'You canceled the job',
workHaveError = 'This train already has a job',
upgradeError = 'You already have this upgrade',
fuelRemove = '%d coal has been removed',
noFuel = 'You don’t have the required fuel %d',
overheat = 'The train has overheated, you need to cool it down',
noCooling = 'You don’t have the items to cool it down',
cooling = 'Cooling the train engine',
Swapped = 'Switch changed',
NoSwitch = 'No switch in sight',
noJobForStash = 'You don’t have the required keys to open',
trainIsOut = 'The train is already out',
noJobTimetable = 'You do not have the necessary permissions for this manipulation',
workCancelError = 'Could not cancel shipment',
boxLoaded = 'You loaded the box',
boxUnloaded = 'You unloaded the box',
noBoxInHand = 'Where did you leave the box?',
bossNoMoney = 'There is no money to withdraw',
deleteTrainWork = 'This train carries a contract, they have to cancel it first.',
noWorkCancel = 'There are no orders for the train',
deliveryError = "You're not near any trains",
},
nui = {
emptyWatermark = 'Empty',
date = 'Date',
time = 'Time',
content = 'From Station - To Station',
price = 'Ticket Price',
actions = 'Edit',
addRow = 'Add',
save = 'Save',

editRow = 'Add',
repeatDaily = 'Repeat Daily',
placeholderDate = 'MM-DD',
placeholderTime = 'HH:MM',
placeholderContent = 'Enter description',
placeholderPrice = 'Enter price',

trainPrice = 'Price:',
trainSpeed = 'Speed:',
trainStash = 'Capacity:',
trainSize = 'Stash Size:',
leftArrow = 'Back',
rightArrow = 'Forward',
buyButton = 'Buy',
cameraButton = 'Camera',
exitButton = 'Exit',

sendButton = 'Confirm',
placeholder = 'Train name',
},
prompt = {
descOpenMenu = 'Train Station',
openMenu = 'Open',
descTimetable = 'Train Noticeboard',
descTimetableAll = 'Large Train Noticeboard',
descManagment = 'Train Management',
relight = 'Relight',
lockSpeed = 'Lock Speed',
unlockSpeed = 'Unlock Speed',
leftSwitch = 'Left',
rightSwitch = 'Right',
descTrainStash = 'Train Storage',
openStash = 'Open Storage',
bag = 'Take/Place Bags',
bagSubmit = 'Submit Bags',
descPostOffice = 'Post Office',
descBoiler = 'Train Boiler',
timetableInteraction = 'Open List',
timetableOpen = 'View Noticeboard',
editTimetable = 'Edit Noticeboard',
repairBoiler = 'Cool Down',
sit = 'Seat',
descSit = 'Chair',
box = 'Box',
boxDesc = 'Cargo for the train',
putUp = 'Pick up',
},
},

}


Train Hash

  • 0x005E03AD
  • 0x0392C83A
  • 0x0660E567
  • 0x0941ADB7 - net_fetch_train_vip_rescue_00
  • 0x09B679D6
  • 0x0CCC2F70
  • 0x0D03C58D
  • 0x0E62D710 - ghost_train_config
  • 0x10461E19
  • 0x124A1F89
  • 0x19A0A288
  • 0x1C043595
  • 0x1C9936BB
  • 0x1EEC5C2A
  • 0x1EF82A51
  • 0x25E5D8FF
  • 0x26509FBB - dummy_engine_config
  • 0x29C81ACB
  • 0x2D1A6F0C
  • 0x2D3645FA
  • 0x31656D23
  • 0x3260CE89 - engine_config
  • 0x35D17C43
  • 0x3ADC4DA9
  • 0x3D72571D - gunslinger3_config
  • 0x3EDA466D - handcart_config
  • 0x41436136
  • 0x487B2BE7 - winter4_config
  • 0x4A73E49C
  • 0x4C9CCB22
  • 0x515E31ED - prisoner_escort_config
  • 0x57C209C4
  • 0x592A5CD0
  • 0x5AA369CA - gunslinger4_config
  • 0x5D9928A4
  • 0x68CF495F
  • 0x6CC26E27
  • 0x6D69A954
  • 0x73722125
  • 0x761CE0AD - net_fetch_train_camp_resupply_00
  • 0x767DEB32 - industry2_config
  • 0x7BD58C4D
  • 0x8864D73A
  • 0x8D0766BC
  • 0x8EAC625C - appleseed_config
  • 0x90CB53CA
  • 0x9296570E
  • 0x96563327
  • 0x98427740
  • 0x9897FF51
  • 0x998A0CBC
  • 0x9CBE6FEC
  • 0x9E096E46
  • 0xA3BF0BEB - net_fetch_train_kidnapped_buyer_00
  • 0xA8B1CEB7
  • 0xA91041A2
  • 0xAA3E691E
  • 0xAC18A9F4
  • 0xAE47CA77 - net_fetch_train_bounty_horde_00
  • 0xAEE0ECF5
  • 0xB1F69614
  • 0xBF69518F - trolley_config
  • 0xC1F1DD80
  • 0xC732CDC8
  • 0xC75AA08C - minecart_config
  • 0xCA19C62A
  • 0xCD2C7CA1
  • 0xD233B18D - net_fetch_train_moving_bounty_1
  • 0xD42DD3EE
  • 0xD5DF2D82
  • 0xD8CF6395
  • 0xD92B16AE
  • 0xD93C36C2
  • 0xDA2EDE2F
  • 0xDC9DD041
  • 0xDD920DAF
  • 0xE0898B89
  • 0xE16CA3EF
  • 0xEB8B2439
  • 0xEF9FC71D
  • 0xEFBFBDD8
  • 0xF19E48CA
  • 0xF6AA98F4
  • 0xF9B038FC - bountyhunter_config
  • 0xFAB2FFB9
  • 0xFAC328F0
  • 0xFD8810E8

Other tracks / Railroad switch

track_open.lua contains the possibility to add tracks and especially avoidance from additional maps. The map creator must provide three pieces of information

track index, railroad switch id and coords where

track_open.lua
RailroadSwitch.Extra = {
[1] = {coords = vec3(-4951.810059, -3083.800049, -18.432350), Index = -1467515357, switch = 1, default = 1},
}

Changelog

No information to display.