Tails Posted December 10, 2015 Share Posted December 10, 2015 (edited) For some reason it's not letting me enter the train, same thing on server side. WarpPedIntoVehicle isn't working either. function interCity() local train = createVehicle(538,-1948.413, -0.929, 25.711) end addEventHandler("onClientResourceStart",resourceRoot,interCity) Any ideas? Edited December 11, 2015 by Guest Link to comment
Tails Posted December 10, 2015 Author Share Posted December 10, 2015 It's not letting me enter any train. Only when I spawn them in through freeroam panel. Did you check the code? Does it work for you? Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 try this maybe server.lua function interCity(thePlayer) local train = createVehicle(538,-1948.413, -0.929, 25.711) warpPedIntoVehicle(thePlayer, train) end addEventHandler("onResourceStart",resourceRoot,interCity) Link to comment
Tails Posted December 10, 2015 Author Share Posted December 10, 2015 Expected ped getting resource-data in debug Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 Expected ped getting resource-data in debug Look the example "warpPedIntoVehicle " in WIKI mta function setupForRace ( ) local RacerPed = createPed ( 252, 0, 0, 3 ) local RaceVehicle = createVehicle ( 411, 4, 0, 3 ) -- create a vehicle. warpPedIntoVehicle ( RacerPed, RaceVehicle ) -- warp the ped straight into the vehicle end addCommandHandler ( "startrace", setupForRace ) Link to comment
ALw7sH Posted December 10, 2015 Share Posted December 10, 2015 You can't enter vehicles created in client side Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 You can't enter vehicles created in client side my example is in server side Link to comment
Tails Posted December 10, 2015 Author Share Posted December 10, 2015 is easy, or not? Sure is. I thought I tested it my code server side but apparently I didn't. There's another issue, however, the train will only go in one direction when driving it? You can't enter vehicles created in client side Thanks, ALw7sH, I did not know that. Link to comment
Tails Posted December 10, 2015 Author Share Posted December 10, 2015 Nope, the train refuses to go in the opposite direction. Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 Nope, the train refuses to go in the opposite direction. otherwise, it worked? Link to comment
Tails Posted December 10, 2015 Author Share Posted December 10, 2015 What do you mean? Server side: function interCity() local train = createVehicle(538,-1948.413, -0.929, 25.711) end addEventHandler("onResourceStart",resourceRoot,interCity) Yes, you can enter the train now. But try it for yourself, it will only go in one direction. Trains just confuse me. They never do what I want. Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 try this Server side: function interCity(thePlayer) local train = createVehicle(538,-1948.413, -0.929, 25.711) warpPedIntoVehicle(thePlayer, train) setVehicleRotation ( train, 0, 0, 270 ) end addEventHandler("onResourceStart",resourceRoot,interCity) Link to comment
Captain Cody Posted December 10, 2015 Share Posted December 10, 2015 well instead of setVehicleRoation, do TrainDirection ( train, 1) --- or 0, depending on direction yeh want. Link to comment
#RooTs Posted December 10, 2015 Share Posted December 10, 2015 well instead of setVehicleRoation, do TrainDirection ( train, 1) --- or 0, depending on direction yeh want. https://wiki.multitheftauto.com/index.p ... fulltext=1 no results of examples, can make a more concrete example? Link to comment
Captain Cody Posted December 10, 2015 Share Posted December 10, 2015 Sorry didn't copy whole thing, search setTrainDirection Link to comment
Captain Cody Posted December 10, 2015 Share Posted December 10, 2015 https://wiki.multitheftauto.com/wiki/SetTrainDirection Link to comment
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