Snow-Man Posted May 12, 2014 Share Posted May 12, 2014 elseif ( state == "left" ) and ( source == gridlist ) then local vehicle = tonumber(guiGridListGetItemText(gridlist, guiGridListGetSelectedItem(gridlist), 2)) if vehicle then mo = getElementModel(vehicle) previewVehicle = createVehicle( mo, 1982.9794921875, 2044.2698974609 ,10.8203125) setCameraMatrix( 1971.8072509766, 2031.4422607422, 28.789499282837, 1972.1690673828, 2031.8653564453, 27.958776473999) end i post part of my script, when i click on car in gridlist it won't be created help please debugs : @getElementModel bad argument and createVehicle the same debug Link to comment
WASSIm. Posted May 12, 2014 Share Posted May 12, 2014 elseif ( state == "left" ) and ( source == gridlist ) then local id = tonumber(guiGridListGetItemText(gridlist, guiGridListGetSelectedItem(gridlist), 2)) if id then previewVehicle = createVehicle( id, 1982.9794921875, 2044.2698974609 ,10.8203125) setCameraMatrix( 1971.8072509766, 2031.4422607422, 28.789499282837, 1972.1690673828, 2031.8653564453, 27.958776473999) end Link to comment
Karuzo Posted May 12, 2014 Share Posted May 12, 2014 Creating vehicles client-side is useless. Since if you create the vehicles client-side you can't enter the car. So better trigger to the server and create it there. Link to comment
Snow-Man Posted May 12, 2014 Author Share Posted May 12, 2014 Creating vehicles client-side is useless.Since if you create the vehicles client-side you can't enter the car. So better trigger to the server and create it there. i know, i only need when i click on car in gridlist it show me vehicle Link to comment
Dealman Posted May 12, 2014 Share Posted May 12, 2014 I think you'll need to use getVehicleModelFromName instead of getElementModel. Can't tell since I don't know how you setup the gridlist. But I'm assuming it's a list of the vehicle names. 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