Jump to content

Displaying Cars when name clicked in Gridlist...


Mann56

Recommended Posts

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

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

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...