Greenie0101 Posted June 11, 2012 Posted June 11, 2012 Hey there! I'm making a resource for I suggestion I did on CIT and need to know something. How do I make a frieght train with 15 cars at LV north train station, drive to SF train station (anticlockwise) and disappear there? Thanks in advance
iChang Posted June 11, 2012 Posted June 11, 2012 function createTrain(source) local myTrain = createVehicle(537,1995,-1949,13) -- Create the train setTrainDirection(myTrain, true) -- Make the train drive clockwise setTrainSpeed(myTrain, 1) -- Speed up end addCommandHandler("mytrain", createTrain) Source: https://wiki.multitheftauto.com/wiki/SetTrainDirection
micheal1230 Posted June 11, 2012 Posted June 11, 2012 Would Be Better To Use -- ServerSide Script addEventHandler("onResourceStart",getRootElement(), function () local myTrain = createVehicle(537,1995,-1949,13) -- Create the train setTrainDirection(myTrain, true) -- Make the train drive clockwise setTrainSpeed(myTrain, 1) -- Speed up end )
JR10 Posted June 11, 2012 Posted June 11, 2012 Using root will trigger for any resource start. -- ServerSide Script addEventHandler("onResourceStart",resourceRoot, function () local myTrain = createVehicle(537,1995,-1949,13) -- Create the train setTrainDirection(myTrain, true) -- Make the train drive clockwise setTrainSpeed(myTrain, 1) -- Speed up end )
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now