it saves all of all of componnets are stay like spoilers front bumpers etc.. and in vehicle column paintjob is set to 0 I mean like paintjob id. When I park car I for second see that paintjob then it's set a color to vehicle and in park part is just creatingvehicle, thanks.
CreateVehicle(Modelid,x,y,z,rotation,color 1,color 2,respawn delay);
firts here is onvehiclespawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
SetVehicleHealth(vehicleid,999.99);
for(new i; i < sizeof VInfo; i++)
{
if(vehicleid == VInfo[i][vownedvehicle]) TuneCar(vehicleid,i);
}
return 1;
}
and here is public tunecar
pawn Код:
forward TuneCar(vehid,v);
public TuneCar(vehid,v)
{
if(VInfo[v][vKomponenta1] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta1]);
}
if(VInfo[v][vKomponenta2] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta2]);
}
if(VInfo[v][vKomponenta3] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta3]);
}
if(VInfo[v][vKomponenta4] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta4]);
}
if(VInfo[v][vKomponenta5] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta5]);
}
if(VInfo[v][vKomponenta6] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta6]);
}
if(VInfo[v][vKomponenta7] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta7]);
}
if(VInfo[v][vKomponenta8] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta8]);
}
if(VInfo[v][vKomponenta9] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta9]);
}
if(VInfo[v][vKomponenta10] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta10]);
}
if(VInfo[v][vKomponenta11] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta11]);
}
if(VInfo[v][vKomponenta12] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta12]);
}
if(VInfo[v][vKomponenta13] > 0)
{
AddVehicleComponent(vehid,VInfo[v][vKomponenta13]);
}
if(VInfo[v][vPaintJob] > -1) in that code here all of this part is set a paintjob to vehicle
{
ChangeVehiclePaintjob(vehid,VInfo[v][vPaintJob]);
}
}