Jump to content

[HELP]Trailer


Black2

Recommended Posts

Hello,I have this script, it adds trailer to the vehicle can see, I wonder how do to disconnect the trailer when the vehicle he comes back doing what ever the trailer is there.

Any idea ? Thx.

function attachTrailer (theVehicle, seat, jacked ) 
    if ( getElementModel (theVehicle) == 514 ) then 
    local x,y,z = getElementPosition(theVehicle) 
        trailer = createVehicle ( 584, x-11, y, z)  
        setElementRotation (trailer, getElementRotation (theVehicle))    
        attachTrailerToVehicle (theVehicle, trailer)  
    end 
end 
addEventHandler("onPlayerVehicleEnter", getRootElement(), attachTrailer) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...