Hallo liebe community,
ich habe folgendes problem und zwar wird beim laden des wagen andauernd der Paintjob überschrieben
hier mal der PAWN-Code:
public OnCarsLoad()
{
new num_rows, num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return print("keine Autos");
for(new i=0; i<num_rows; i++)
{
new vID = getFreeCarID();
vInfo[vID][v_db_id]= cache_get_field_content_int(i,"id",dbhandle);
vInfo[vID][v_nummer]=cache_get_field_content_int(i,"nummer",dbhandle);
vInfo[vID][v_vehicle_id]= cache_get_field_content_int(i,"vehicleid",dbhandle);
vInfo[vID][v_x]= cache_get_field_content_float(i,"x",dbhandle);
vInfo[vID][v_y]= cache_get_field_content_float(i,"y",dbhandle);
vInfo[vID][v_z]= cache_get_field_content_float(i,"z",dbhandle);
vInfo[vID][v_r]= cache_get_field_content_float(i,"r",dbhandle);
vInfo[vID][v_paintjob]=cache_get_field_content_int(i,"paintjob",dbhandle);
vInfo[vID][v_Color1]= cache_get_field_content_int(i,"Color1",dbhandle);
vInfo[vID][v_Color2]= cache_get_field_content_int(i,"Color2",dbhandle);
vInfo[vID][v_fraktion]= cache_get_field_content_int(i,"fraktion",dbhandle);
if(vInfo[vID][v_paintjob]==10)
{
vInfo[vID][v_id_x]= CreateVehicle(vInfo[vID][v_vehicle_id],vInfo[vID][v_x],vInfo[vID][v_y],vInfo[vID][v_z],vInfo[vID][v_r],vInfo[vID][v_Color1],vInfo[vID][v_Color2],0);
}
else
{
vInfo[vID][v_id_x]= CreateVehicle(vInfo[vID][v_vehicle_id],vInfo[vID][v_x],vInfo[vID][v_y],vInfo[vID][v_z],vInfo[vID][v_r],vInfo[vID][v_Color1],vInfo[vID][v_Color2],0);
ChangeVehiclePaintjob(vInfo[vID][v_id_x],vInfo[vID][v_paintjob]);
}
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Spoiler",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Hood",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Roof",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Sideskirt",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Lamps",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Nitro",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Exhaust",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Wheels",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Stereo",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Hydraulics",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Front_Bumper",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Rear_Bumper",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Vent_Left",dbhandle));
AddVehicleComponent(vInfo[vID][v_id_x],cache_get_field_content_int(i,"Vent_Right",dbhandle));
printf("Auto Type: %i, ID: %i geladen...",vInfo[vID][v_vehicle_id],vID);
}
print("Alle autos geladen!");
return 1;
}