Added File / New Effect:

- Vehs/VehicleDerailTrains
This commit is contained in:
2025-10-01 19:13:19 +01:00
parent b92c9dcbe6
commit f0508a90fd

View File

@@ -0,0 +1,31 @@
EffectInfo = {
Name = "Derail Trains",
EffectId = "vehs_derailtrains",
TimedType = "Normal",
EffectGroup = "_group_trafficspawner",
EffectCategory = "None"
IncompatibleIds = {
"vehs_expresstrains",
}
}
function OnStart()
end
function OnStop()
for _, vehicle in ipairs(GetAllVehicles()) do
if GET_VEHICLE_CLASS(vehicle) == 21 then
SET_RENDER_TRAIN_AS_DERAILED(vehicle, false)
end
end
end
function OnTick()
SET_RANDOM_TRAINS(true)
for _, vehicle in ipairs(GetAllVehicles()) do
if GET_VEHICLE_CLASS(vehicle) == 21 then
SET_TRAIN_SPEED(vehicle, 0.0)
SET_RENDER_TRAIN_AS_DERAILED(vehicle, true)
end
end
end