Moin,
Ich habe ein Autohaus, ich erstelle die Autos auf dem Server und Speicher sie in einer MySql Tabelle ab.
Ich habe zum testen mal einige Autos gespawnt und habe sie dann aus meiner Tabelle gelöscht doch jetzt Steigt die ID trotzdem auch wenn kein Auto in der Tabelle ist.
stock CreateCar(cmodel, Float:cx, Float:cy, Float:cz, Float:cr, cc1, cc2, cprice)
{
new query[600],query2[600],query3[1200],tempplate[30], id = 0;
format(tempplate, 30, "Niemand");
format(query, 600, "INSERT INTO `cars` (`id`, `owner`, `x`, `y`, `z`, `r`, `c1`, `c2`, `plate`, `model`, `price`, `mod1`, `mod2`, `mod3`, `mod4`, `mod5`, `mod6`, `mod7`, `mod8`, `mod9`, `mod10`, `mod11`, `mod12`, `mod13`, `mod14`, `mod15`, `mod16`, `mod17`)");
format(query2, 600, "VALUES ('%d', 'Niemand', '%f', '%f', '%f', '%f', '%d', '%d', '%s', '%d', '%d', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1', '-1');",id,cx, cy, cz, cr, cc1, cc2, tempplate, cmodel, cprice);
format(query3, 600, "%s %s",query,query2);
mysql_query(query3);
Car[id][car] = AddStaticVehicleEx(cmodel, cx, cy, cz, cr, cc1, cc2, -1);
SetVehicleNumberPlate(Car[id][car], "Niemand");
return 1;
}