Jump to content

[Help] Creating Vehicle


Recommended Posts

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

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

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