not really a fix but a work around
i found a script called airbrake which is like no clip for vehicles in mta
if you use it in the train you never derail and can drive all the way around the track
here u go
local thisResourceRoot = getResourceRootElement(getThisResource())
function activateBreak ( )
if ( carbreak ) then
carbreak = nil
setGravity ( 0.008 )
removeEventHandler ( "onClientRender", getLocalPlayer(), checkBreak )
else
carbreak = 1
local vehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )
setElementVelocity ( vehicle, 0, 0, 0 )
setGravity ( 0.0002 )
addEventHandler ( "onClientRender", getLocalPlayer(), checkBreak )
end
end
addCommandHandler ( "airbrake" , activateBreak )
function thisResourceStart ()
bindKey ( "f9", "down", activateBreak, "AirBreakDance" )
end
function checkBreak()
if isPlayerInVehicle (getLocalPlayer()) then
local vehicle = getPlayerOccupiedVehicle ( getLocalPlayer() )
setElementVelocity ( vehicle, 0, 0, 0 )
local px, py, pz = getElementPosition ( vehicle )
local rx, ry, rz = getVehicleRotation ( vehicle )
setVehicleRotation ( vehicle, 0, 0, rz)
if ( getKeyState ( "num_8") ) then
local x = (2)*math.cos((rz+90)*math.pi/180)
local y = (2)*math.sin((rz+90)*math.pi/180)
local nx = px + x
local ny = py + y
setVehicleRotation ( vehicle, 0, 0, rz)
setElementPosition ( vehicle, nx, ny, pz )
end
if ( getKeyState ( "num_5") ) then
local x = (-2)*math.cos((rz+90)*math.pi/180)
local y = (-2)*math.sin((rz+90)*math.pi/180)
local nx = px + x
local ny = py + y
setVehicleRotation ( vehicle, 0, 0, rz)
setElementPosition ( vehicle, nx, ny, pz )
end
if ( getKeyState ( "num_4") ) then
setVehicleRotation ( vehicle, 0, 0, rz + 5)
end
if ( getKeyState ( "num_6") ) then
setVehicleRotation ( vehicle, 0, 0, rz - 5)
end
if ( getKeyState ( "num_add") ) then
setElementPosition ( vehicle, px, py, pz + 2)
end
if ( getKeyState ( "num_sub") ) then
setElementPosition ( vehicle, px, py, pz - 2)
end
end
end
addEventHandler ( "onClientResourceStart", thisResourceRoot, thisResourceStart )
dont know if this will help but my son quite likes it as he likes driving the trains