pawn Код:
stock LoadVehiclesFromBD()
{
new DBResult:Result;
new modelid,SpawnX,SpawnY,SpawnZ,SpawnRot,vehicles_loaded,vid;
Result = db_query( Database, "SELECT * FROM `VEHICLES`" );
print("Loading vehicles from: database.... please waite....");
for(new a,r=db_num_rows(Result);a<r;a++)
{
new str[256],str2[32];
db_get_field_assoc(Result,"MODEL",str2,32);
strcat(str,str2);
strcat(str," ");
db_get_field_assoc(Result,"X",str2,32);
strcat(str,str2);
strcat(str," ");
db_get_field_assoc(Result,"Y",str2,32);
strcat(str,str2);
strcat(str," ");
db_get_field_assoc(Result,"Z",str2,32);
strcat(str,str2);
strcat(str," ");
db_get_field_assoc(Result,"R",str2,32);
strcat(str,str2);
if(!sscanf(str, "iffff", modelid,SpawnX,SpawnY,SpawnZ,SpawnRot))
{
//vid = AddStaticVehicleEx(modelid,SpawnX,SpawnY,SpawnZ,SpawnRot,-1,-1,60);
vid = AddStaticVehicle(modelid,SpawnX,SpawnY,SpawnZ,SpawnRot,-1,-1);
LinkVehicleToInterior(vid, 0);
SetVehicleVirtualWorld(vid, 0);
printf("veh (%i) %s",vid,str);
vehicles_loaded++;
}
db_next_row(Result);
}
db_free_result(Result);
printf("Loaded %d vehicles from: database",vehicles_loaded);
return 1;
}
so it prints to the log every vehicle from the db (1827) in this case.
just getting my data from the db.
maybe im missing something here...