Tuning all cars in mode
#1

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....
Reply
#2

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
Reply
#3

OnVehicleSpawn(vehicleid)
{
SetTimerEx("Public", time, looping, "i", vehicleid);
return 1;
}
forward Public(veh);
public Public(veh)
{
return AddVehicleComponent(veh, cid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)