heavy air Posted February 9, 2008 Share Posted February 9, 2008 Hello i am trying to create a console command that lets me change vehicle model while in the vehicle EG. buffalo - ibto - AT400 i have managed to add speed boost, stick to vehicles and spawn ramp commands but i just cant figure this one out mostly i borrow and edit scripts from other resources in mta but i cant seem to find anything that does this i have also tried using createpickup to set a vehicle change pickup but i dont know what the ID number is ANY HELP OR IDEAS GREATLY APPRECIATED Link to comment
fgwelder Posted February 10, 2008 Share Posted February 10, 2008 Use this function: http://development.mtasa.com/index.php? ... hicleModel Link to comment
heavy air Posted February 10, 2008 Author Share Posted February 10, 2008 I have tried writing the function according to this but i just cant get the syntax right i am very new to scripting and really dont know what im doing tbh so far ive been able to look at the way things are donr in other scripts and figure out what i need to write to get the effect i want but this ones really difficult for some reason thanx for the help though i am still workin on it and will post if have any progress THANX AGAIN edit: is this even close function consoleChangeVehicle ( player, command, id ) if ( player ) then local = getPlayerOccupiedVehicle x, y, z, rx, ry, rz x, y, z = getElementPosition ( player ) rx, ry, rz = getVehicleRotation ( player ) then setVehicleModel ( player, id ) end end Link to comment
Jumba' Posted February 10, 2008 Share Posted February 10, 2008 Uhm, should the second then be there? you could just remove that I think, and why are you getting the coords and rotation? it just changes the model of the vehicle, so I think it'd be like function consoleChangeVehicle ( player, command, id ) if ( id ) then local newCar = tonumber( id ) local oldCar = getPlayerOccupiedVehicle( player ) setVehicleModel ( oldCar, newCar ) else outputChatBox( "You forgot to specify the car id", player ) end end But I cant test it cause my game freezes up when I play, so I dont know if it works Link to comment
heavy air Posted February 10, 2008 Author Share Posted February 10, 2008 A_mazing my friend works perfect and even keeps the same colors THANK U VERY MUCH!!!!!!!!!!!!!!!!!!!! confused my self a bit in my scripti was basing my script on the createvehicle command and didnt realize getoccupiedvehicle would give me all the position data for the new vehicle 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