SA-MP Forums Archive
[SOLVED] Tunning the car - 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: [SOLVED] Tunning the car (/showthread.php?tid=93303)



[SOLVED] Tunning the car - BMW_M3_GTR - 24.08.2009

Hi, I have a problem with tunning my car.
When i first time get on with the car, it is tunned, but when it dies, and respawn, its no longer tunned. Can you help me? Here is my code:

Код:
new car;

public OnGameModeInit()
{
car=AddStaticVehicle(542,-1834.9572,1288.3302,31.5905,23.2091,3,82);
AddVehicleComponent(car, 1010); // 10x Nitro
AddVehicleComponent(car, 1014); // Spoiler Champ
AddVehicleComponent(car, 1019); // Twin Exhaust
AddVehicleComponent(car, 1082); // Wheels Import
AddVehicleComponent(car, 1144); // Square vents
AddVehicleComponent(car, 1145); // Square vents
AddVehicleComponent(car, 1087); // Hydraulics
AddVehicleComponent(car, 1086); // Stereo
ChangeVehicleColor(car,3,115);
}
I tried this but it didnt work:
Код:
public OnVehicleSpawn(vehicleid)
{
if(vehicleid==car)
	  {
	  AddVehicleComponent(car, 1010); // 10x Nitro
AddVehicleComponent(car, 1014); // Spoiler Champ
AddVehicleComponent(car, 1019); // Twin Exhaust
AddVehicleComponent(car, 1082); // Wheels Import
AddVehicleComponent(car, 1144); // Square vents
AddVehicleComponent(car, 1145); // Square vents
AddVehicleComponent(car, 1087); // Hydraulics
AddVehicleComponent(car, 1086); // Stereo
ChangeVehicleColor(car,3,115);	  
}
}
Any help? Thanks


Re: Tunning the car - CAR - 24.08.2009

You don't need this:
Код:
if(vehicleid==car)
Delete it!



Re: Tunning the car - James_Alex - 24.08.2009

no he need it to check the vehicle id
and i think you must set a timer of 1 second in "OnVehicleSpawn" then do all the functions after the timer


Re: Tunning the car - BMW_M3_GTR - 24.08.2009

Quote:
Originally Posted by ► James_Alex
no he need it to check the vehicle id
and i think you must set a timer of 1 second in "OnVehicleSpawn" then do all the functions after the timer
Ok, i will try it.


Re: Tunning the car - BMW_M3_GTR - 24.08.2009

Yeah, it works !
Thank you very much!!!


SOLVED