_SET_TRAIN_MAX_SPEED at exactly 30.0 breaks the train — cap at 29.9 (the documented "max 30.0" is exclusive in practice)
Context
_SET_TRAIN_MAX_SPEED (0x9F29999DFDF2AEB8)(train, speed) raises the speed ceiling so a player-driven mission train can actually accelerate. The native docs note "Maximum possible speed is 30.0 (108 km/h)", so you naturally pass 30.0 to get the fastest train.
The trap (verified in-game, build 1491)
Passing exactly 30.0 breaks the train — it stalls / glitches / fails to move properly rather than running at top speed. The documented maximum behaves as an exclusive bound, not an inclusive one.
The fix
Cap at 29.9 (or any value just under 30.0). At 29.9 the train runs at full speed with no glitching. So the usable range is effectively (0.0, 30.0) — never hand it the literal ceiling.
-- _SET_TRAIN_MAX_SPEED — use 29.9, NOT 30.0
Citizen.InvokeNative(0x9F29999DFDF2AEB8, train, 29.9)
Practical mid-range value if you want a slower, more controllable train: many scripts use ~15.0. But if you want "as fast as possible," 29.9 is the number, not 30.0.
Linked natives
_SET_TRAIN_MAX_SPEED(0x9F29999DFDF2AEB8)
Tags: trains, vehicles, mission-train, speed, railroad
Category: natives
Source: scandi-railroad-poc
Created: 2026-05-22T18:00:22.241Z