Jump to content

Defining multiple elements/cars at the same time?


kevin433

Recommended Posts

Hi,

I'm currently working on my Vehicle system. Now I want to spawn multiple cars at the same time, and that's working, but I want to set the Vehicle Color for each, and I'm using a for loop. How can I do this? That's how my code i currently looking:

function createCar()
local resultvehicle = executeSQLSelect("Vehicles","*")
if(#resultvehicle == 0) then	 
 
else
for i = 1, 2 do
createVehicle(resultvehicle[i].ModelID, resultvehicle[i].PosX,resultvehicle[i].PosY,resultvehicle[i].PosZ)
end
end
end
addCommandHandler("createcar", createCar)

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