Jump to content

createVehicle in carshop


itHyperoX

Recommended Posts

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 by TheMOG
Link to comment
-- 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 by msyyn
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...