Mann56 Posted January 28, 2016 Share Posted January 28, 2016 Hey guys, I am working on a vehicle-system. I have seen many servers having vehicle shops have images of the car when clicked to preview before buying the car. I have made a gridlist and i want to do like : Whenever a guy clicks a car he can see the car in the background. I thought of using images but they would be too static... Is there any way to also make vehicles visible when their name is clicked upon and if possible some rotation to them to make a feel like a real showroom? Link to comment
tosfera Posted January 28, 2016 Share Posted January 28, 2016 use createVehicle when the user clicked a vehicle or even setElementModel to change the vehicle's model once they select a new one. Then simply add a rotation timer to it that makes it rotate every 50ms. Link to comment
Mann56 Posted January 28, 2016 Author Share Posted January 28, 2016 Thanks tosfera! The script i made is working fine but it blows up vehicles when i try to get rid of em. blowVehicle doesn't allow silent blowing up and explodes... Is there any other way to prevent explosion? My code function click() local getName = guiGridListGetItemText ( grid.car, guiGridListGetSelectedItem ( grid.car ), 3 ) if not vehView then vehView = createVehicle(getName,-1952.0537109375,263.626953125,41.047080993652) else local modelType = getElementModel(vehView) if getName == modelType then return else local blow = blowVehicle(vehView) vehView = createVehicle(getName,-1952.0537109375,263.626953125,41.047080993652) end end setCameraMatrix(-1956.177734375,263.4619140625,41.047080993652,-1952.0537109375,263.626953125,41.047080993652) end EDIT : Solved , used destroyElement instead of blowVehicle. Silly me, i forgot destroyElement... Anyway thanks tosfera for the wonderful idea! 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