itHyperoX Posted November 17, 2017 Share Posted November 17, 2017 (edited) Hello, i have these in my carshop: local carName = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),1) local carID = getVehicleModelFromName(carName) local carCost = guiGridListGetItemText(carglVehicleSelection,guiGridListGetSelectedItem(carglVehicleSelection),2) setCameraMatrix(1983.1341552734, 2044.189453125, 12.663800239563, 1983.1794433594, 2045.1231689453, 12.308508872986) How can i make that, if i select a different vehicle, its creating a vehicle, when i click on another vehicle, the vehicle model changing ? I tried: -- Just showcase car car = createVehicle(carID,1982.0382080078, 2055.3986816406, 10.8203125) if isElement(car) then outputChatBox(carID) setElementModel(car, carID) end But its keep creating a new vehicle I want to make "Showcase car". Edited November 17, 2017 by TheMOG Link to comment
msyyn Posted November 17, 2017 Share Posted November 17, 2017 (edited) -- Just showcase car if car and isElement(car) then destroyElement(car) end car = createVehicle(carID,1982.0382080078, 2055.3986816406, 10.8203125) You should also consider setting fixed color for the car so it doesn't give random color each time you create new preview car setVehicleColor(car, 255, 255, 255, 13, 13, 13, 13, 13, 13) Or make an color picker so users can preview the display car on different colors Edited November 17, 2017 by msyyn Link to comment
itHyperoX Posted November 17, 2017 Author Share Posted November 17, 2017 I fixed it thank you. 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