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 New CMG 2.0 Screenshot! http://img560.imageshack.us/img560/4269/cmg2screen.png CMG 2.0 Trailer! Learn to script from simple video tutorials completely free! Click here for forum page Was the scripter for CMG server! Leaving CMG: 100%
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 ) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Greenie0101 Posted June 12, 2012 Author Posted June 12, 2012 thanks alot! how to add carrages tho? New CMG 2.0 Screenshot! http://img560.imageshack.us/img560/4269/cmg2screen.png CMG 2.0 Trailer! Learn to script from simple video tutorials completely free! Click here for forum page Was the scripter for CMG server! Leaving CMG: 100%
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