Wei Posted May 10, 2012 Author Share Posted May 10, 2012 ok. 1 question more. How can add on gridlist vehicle IDs. I know that I need to make some kind of table. Link to comment
Castillo Posted May 10, 2012 Share Posted May 10, 2012 By vehicle ID's you mean their vehicle model? Link to comment
Castillo Posted May 10, 2012 Share Posted May 10, 2012 getElementModel or getVehicleModelFromName Link to comment
Wei Posted May 10, 2012 Author Share Posted May 10, 2012 getElementModel or getVehicleModelFromName But how can I add or wich table i need to create... I've worked with players but not with vehicles Link to comment
Castillo Posted May 10, 2012 Share Posted May 10, 2012 You want all server vehicles currently created? if so use: for index, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- Code here end Link to comment
Wei Posted May 10, 2012 Author Share Posted May 10, 2012 I want to make a list of vehicles. I want to make a kind of carshop. Link to comment
Axel Posted May 10, 2012 Share Posted May 10, 2012 local vehs = getElementsByType("vehicle") for i,v in ipairs (vehs) do local carId = getVehicleNameFromModel(v) local row = guiGridListAddRow(yourList) -- change yourList to your list's name.. guiGridListSetItemText (yourList, row, 1, carID, false, true) guiGridListSetItemText (yourList, row, 2, v, false, true) end Link to comment
Wei Posted May 10, 2012 Author Share Posted May 10, 2012 function carSpawn () local Acc = getPlayerAccount( source ) local x,y,z = getElementPosition (source) local theFar = getAccountData( Acc, "theCar" ) veh = createVehicle(tonumber (theFar), x,y,z) warpPedIntoVehicle( source, veh ) end addCommandHandler( "spawnMyCar", carSpawn) whats the problem ? Link to comment
Axel Posted May 10, 2012 Share Posted May 10, 2012 function carSpawn () local acc = getPlayerAccount(source) local x,y,z = getElementPosition(source) local theCar = getAccountData(Acc,"theCar") veh = createVehicle(tostring(theCar),x,y,z) warpPedIntoVehicle(source,veh) end addCommandHandler( "spawnMyCar", carSpawn) Link to comment
Edikosh998 Posted May 10, 2012 Share Posted May 10, 2012 function carSpawn (source) -- local Acc = getPlayerAccount( source ) local x,y,z = getElementPosition (source) local theFar = getAccountData( Acc, "theCar" ) veh = createVehicle(tonumber (theFar), x,y,z) warpPedIntoVehicle( source, veh ) end addCommandHandler( "spawnMyCar", carSpawn) 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