Added File / New Effect:
- Vehs/VehicleDerailTrains
This commit is contained in:
31
Vehs/VehicleDerailTrains.lua
Normal file
31
Vehs/VehicleDerailTrains.lua
Normal 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
|
Reference in New Issue
Block a user