heavy air Posted February 14, 2008 Posted February 14, 2008 Hi Every body i have working on this function function launch ( player, command ) local x, y, z = getElementPosition ( player ) local theVehicle = getPlayerOccupiedVehicle ( player ) local a,b,r = getVehicleRotation ( theVehicle ) x = x - math.sin ( math.rad® ) * 20 y = y + math.cos ( math.rad® ) * 20 ramp = createObject ( 1633, x, y, z, 0, 0, r ) setTimer ( RemoveRamp, 999999, 1, ramp ) local veh = getPlayerOccupiedVehicle ( player ) local vx, vy, vz = getElementVelocity ( veh ) setElementVelocity ( veh, vx*10, vy*10, vz*10 ) setTimer ( setVehicleModel, 10, 1, "511" ) end what i want to do is spawn a ramp / jump it really fast ( to get airborne ) / and turn into a plane ( used setTimer so it would change vehicle once im airborne the ramp and the speed up work fine but it doesnt change vehicle i have tried calling another change vehicle function i nthe script but that didnt work either ANY IDEAS Thanx for Lookin MTA the gift that keeps on giving ALL! HAIL! THE MTA TEAM!!!
Jumba' Posted February 14, 2008 Posted February 14, 2008 function launch ( player, command ) local x, y, z = getElementPosition ( player ) local theVehicle = getPlayerOccupiedVehicle ( player ) local a,b,r = getVehicleRotation ( theVehicle ) x = x - math.sin ( math.rad(r) ) * 20 y = y + math.cos ( math.rad(r) ) * 20 ramp = createObject ( 1633, x, y, z, 0, 0, r ) setTimer ( RemoveRamp, 999999, 1, ramp ) local veh = getPlayerOccupiedVehicle ( player ) local vx, vy, vz = getElementVelocity ( veh ) setElementVelocity ( veh, vx*10, vy*10, vz*10 ) setTimer ( setVehicleModel ( The Vehicle, 511 ), 1000, 1) end Your syntax for setTimer is wrong, I dont really know whats wrong but try the one posted above.
heavy air Posted February 14, 2008 Author Posted February 14, 2008 thanx buddy i thought i had the syntax for timer right going by the mta wiki ill give it a try now Have just tried it and mostly works but still get bad argument for set timer ramp spawns / vehicle boosts / vehicle changes but all at the same time usually end up destroying the plane because it hits the ramp will keep tryin and see what i can figure out still not sure what i did wrong in the syntax for timer on the mta wiki it says optional argument should be at end of line and i thought thats where i should put the vehicle id thanks for the help again JUMBA u really know your stuff THANX AGAIN EDIT : got it workin function launch ( player, command ) local x, y, z = getElementPosition ( player ) local theVehicle = getPlayerOccupiedVehicle ( player ) local a,b,r = getVehicleRotation ( theVehicle ) x = x - math.sin ( math.rad® ) * 20 y = y + math.cos ( math.rad® ) * 20 ramp = createObject ( 1633, x, y, z, 0, 0, r ) setTimer ( RemoveRamp, 999999, 1, ramp ) local veh = getPlayerOccupiedVehicle ( player ) local vx, vy, vz = getElementVelocity ( veh ) setElementVelocity ( veh, vx*10, vy*10, vz*10 ) setTimer ( setVehicleModel, 500, 1, theVehicle, 511 ) end function RemoveRamp (ramp) destroyElement(ramp) end need to reduce the speed boost a bit though / when your drivin fast car tends to flip and plane spawns upside down THANX for the help once again JUMBA u rock MTA the gift that keeps on giving ALL! HAIL! THE MTA TEAM!!!
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