Turbe$Z Posted April 22, 2017 Share Posted April 22, 2017 i want attach to the train what i drive, but how? Link to comment
SheriFF Posted April 22, 2017 Share Posted April 22, 2017 Use attachTrailerToVehicle function Link to comment
Turbe$Z Posted April 22, 2017 Author Share Posted April 22, 2017 (edited) 54 minutes ago, *BeaT* said: Use attachTrailerToVehicle function addCommandHandler("tt", function (player) if isPedInVehicle (player) then local theVehicle = getPedOccupiedVehicle(player) if getVehicleType(theVehicle) == "Train" then trailer = createVehicle ( 570, 0, 0, 4 ) attachTrailerToVehicle ( theVehicle, trailer ) outputChatBox("#FFffFFSikeresen létrehoztál egy vagont!", player, r,g,b, true) else outputChatBox("#FFffFFMozdonyban kell ülnöd ehhez!", player, r,g,b, true) end end end ) addEventHandler ( "onPlayerVehicleExit", getRootElement(), function ( vehicle, seat, jacked, player ) local theVehicle = getPedOccupiedVehicle(player) if isPedInVehicle (player) then if getVehicleType(theVehicle) == "Train" then detachTrailerFromVehicle(theVehicle) end end end ) why not working detach? Edited April 22, 2017 by Turbo777 Link to comment
SheriFF Posted April 22, 2017 Share Posted April 22, 2017 Event parameters Quote Parameters vehicle theVehicle, int seat, player jacker theVehicle: A vehicle element representing the vehicle in which the player exited from seat: An integer representing the seat in which the player was before exiting jacker: A player element representing the player who jacked the driver Source The source of this event is the player that left the vehicle. addEventHandler ( "onPlayerVehicleExit", getRootElement(), function ( vehicle, seat, jacked ) if getVehicleType(theVehicle) == "Train" then detachTrailerFromVehicle(theVehicle) end end, ) 1 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