Hi,
I want to load the carinformation from the mysql-table, but there is something wrong with "createVehicle". I hope you can help me.
function carspawn ( )
handler = mysql_connect("localhost", "table", "pass", "user")
cars = mysql_query(handler, "SELECT * FROM vehicles" )
pCars = mysql_fetch_row( cars )
for i, cars in pairs (pCars) do
createVehicle( cars[i].model, cars[i].posx, cars[i].posy, cars[i].posz )
end
if (not cars) then
outputDebugString("Error executing the query: (" .. mysql_errno(handler) .. ") " .. mysql_error(handler))
else
mysql_free_result(cars)
end
end
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), carspawn )