forward OnFrakCarsLoad();
public OnFrakCarsLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
printf("num_rows=%d,num_fields=%d",num_rows,num_fields);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=getFreeCarID();
fInfo[id][model]=cache_get_field_content_int(id,"model",dbhandle);
fInfo[id][fid]=cache_get_field_content_int(id,"Frakid",dbhandle);
fInfo[id][f_c1]=cache_get_field_content_int(id,"color1",dbhandle);
fInfo[id][f_c2]=cache_get_field_content_int(id,"color2",dbhandle);
fInfo[id][f_x]=cache_get_field_content_float(id,"PosX",dbhandle);
fInfo[id][f_y]=cache_get_field_content_float(id,"Posy",dbhandle);
fInfo[id][f_z]=cache_get_field_content_float(id,"PosZ",dbhandle);
fInfo[id][f_r]=cache_get_field_content_float(id,"PosR",dbhandle);
fInfo[id][caridd]=cache_get_field_content_int(id,"carid",dbhandle);
fInfo[id][db_id]=cache_get_field_content_int(id,"id",dbhandle);
//fInfo[id][kmstand]=cache_get_field_content_float(id,"kmstand",dbhandle);
fInfo[id][id_x]=CreateVehicle(fInfo[id][model],fInfo[id][f_x],fInfo[id][f_y],fInfo[id][f_z],fInfo[id][f_r],fInfo[id][f_c1],fInfo[id][f_c2],-1);
printf("Fahrzeuge geladen und erstellt %d",fInfo[id][model]);
}
return 1;
}
Alles anzeigen
Probier das mal