[SOLVED] Tunning the car
#1

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

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

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

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

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


SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)