Tuning all cars in mode - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tuning all cars in mode (
/showthread.php?tid=83583)
Tuning all cars in mode -
RAEN - 26.06.2009
To tuning my car after spawn I need create:
new VEHICLE;
.......
VEHICLE = CreateVehicle(VEHICLEID, X, Y, Z, COLOR1, COLOR2,TIME);
....
OnVehicleSpawn(vehicleid)
{
SetTimer("TuneVehicle",1000,0);
return1;
}
...
public TuneVehicle()
{
AddVehicleComponent(VEHICLE, COMPONENTID);
return 1;
}
...etc
But How Can I use this for all my vehicles ?
Because my GM is so big - 600 cars, and create to each car
new VEHICLE;
new VEHICLE2;
new VEHICLE3; etc
it's so hard....
Re: Tuning all cars in mode -
abhinavdabral - 26.06.2009
just make a new timer, looped one, that will check all the cars (From 0 to whatever) by a FOR loop, and then will check thier model ID and tune them according to what they support.
NOTE: Do not try to add same thing in all the cars because if the car doent supports that Tuning, You will get crashed.
Thank You
-Abhinav
Re: Tuning all cars in mode -
G_ROW_Chez - 29.06.2009
OnVehicleSpawn(vehicleid)
{
SetTimerEx("Public", time, looping, "i", vehicleid);
return 1;
}
forward Public(veh);
public Public(veh)
{
return AddVehicleComponent(veh, cid);
}