02.04.2013, 08:12
Guys I have Just Edited The GarHouse And Made A Tuned Car For It. It Has Switch Wheels , but when it respawns it does not have those wheels it has its original wheels . IS There Any Solution for it ?
Mods need to be put on cars each time it spawns IIRC, so create a function that spawns a modded car.
Or use this callback maybe https://sampwiki.blast.hk/wiki/OnVehicleSpawn |
public OnVehicleSpawn(vehicleid)
{
Loop(h,MAX_HOUSES)
{
if(vehicleid == HouseCar[h])
{
new file[256];
format(file,sizeof(file),FILEPATH,h);
AddVehicleComponent(vehicleid,dini_Int(file,"HCarWheels"));
}
return 1;
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
Loop(h,MAX_HOUSES)
{
if(vehicleid == HouseCar[h])
{
new file[256];
format(file,sizeof(file),FILEPATH,h);
AddVehicleComponent(vehicleid,dini_Int(file,"HCarWheels"));
return 1;//return only if vehicle is found.
}
}
return 1;
}
I edited my post, your code was returning after the first iteration. See the difference between the code you posted and the code i posted. (see comment) The return value doesn't matter in this case, just the fact that you are returning after the first iteration.
|
if(vehicleid == HouseCar[h])