stock LoadPriVeh() { new Query[1024], ID, Modeliukas, Owners, Spalvos1, Spalvos2, Pos[4], Nusipirkau; format(Query, sizeof(Query), "SELECT * FROM `automobiliai` WHERE 'ID'"); mysql_store_result(); if(mysql_num_rows() > 0) { while(mysql_fetch_row(Query)) { MasinosI[ID][Modelis] = Modeliukas; MasinosI[ID][Savininkass] = Owners; MasinosI[ID][Spalva1] = Spalvos1; MasinosI[ID][Spalva2] = Spalvos2; MasinosI[ID][x] = Pos[0]; MasinosI[ID][y] = Pos[1]; MasinosI[ID][z] = Pos[2]; MasinosI[ID][a] = Pos[3]; MasinosI[ID][Perkama] = Nusipirkau; new Masinukas = CreateVehicle(Modeliukas, Pos[0], Pos[1], Pos[2], Pos[3], Spalvos1, Spalvos2, 500000); SetVehicleNumberPlate(Masinukas, "Cbb"); } } return 1; }
WHERE 'ID'
if(mysql_num_rows() > 0)
MasinosI[0][x] = Pos[0];
MasinosI[0][y] = Pos[1];
MasinosI[0][z] = Pos[2];
MasinosI[0][a] = Pos[3];
if(cache_num_rows() != 0) // Example of loading vehicles using MySQL R33. Forgot how R6 and under works.
{
for(new i = 0; i != cache_num_rows(); i++)
{
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
cache_get_field_content_int(i, "Value", MasinosI[i][Value]); // Fetching & Assigning Data
// Then go on to create the vehicle
}
}
Wow, how did no one notice yet that there's no query being actually sent?
![]() |