[Tutorial] [TUT]How to Tuned Car Spawns[TUT]
#1

hey, Cr@zY! J?e here, well .. i saw a FS wich lets you add tuned cars, but why is it a FS? it has .. what? 200 lines? so.. i thaught id'e make a tutorial, also my friend asked me to show him how to add it to a GM, as he has 16 FS's soo.. this is realy easy, before u start saying " NOOB ITS EASY GTFO THESE FORUMS! " think of the "noobs" that don't know or just cannot do it

Top OF Script:

pawn Код:
forward TuneVehicle();

new VEHICLE; // Adds your car, name it whatever you would like.
OnGameModeInit() Or OnFilterScriptInit() :

pawn Код:
VEHICLE = AddStaticVehicle(VEHICLEID, X, Y, Z, ANGLE, COLOR1, COLOR2); //vehicleid = The MODEL ID of the vehicle, you can get a list HERE

TuneVehicle(); // Tunes the vehicle.
Under OnVehicleSpawn(vehicleid) :
pawn Код:
SetTimer("TuneVehicle",1000,0);
as pandabeer pointed out, this is a timer to ensure that wen the vehicle respawns, the components are added, also, you need a timer, not just " TuneVehicle(); " otherwise, it would tune the vehicle BEFORE it actualy spawns.

Bottom of your script:
pawn Код:
public TuneVehicle()
{
    AddVehicleComponent(VEHICLE, COMPONENTID); // COMPONENTID = The ID of the component you wish to add to the vehicle.
    return 1;
}
Wasn't hard now was it? no well.. heres some stuff you might want to know!

pawn Код:
forward TuneVehicle(); - Is needed for the public TuneVehicle() to work.
pawn Код:
new VEHICLE = AddStaticVehicle(VEHICLEID, X, Y, Z, ANGLE, COLOR1, COLOR2);
- MODELID - the model id of the vehicle you wish to make

X, Y, Z - the coordinates to wich the vehicle is spawned.

COLOR1, COLOR2, - the colors of the vehicle.

pawn Код:
SetTimer("TuneVehicle",1000,0);
- This is needed as if we spawn the vehicle , the components are added before the vehicle is actualy spawned, "TuneVehicle" - FunctionName

tharefor, it adds the components AFTER the vehicle spawns.

1000 - 1 second in milliseconds.

0 - repeating = false.

pawn Код:
public TuneVehicle()
{
    AddVehicleComponent(VEHICLE, COMPONENTID); // COMPONENTID = The ID of the component you wish to add to the vehicle.
    return 1;
}
No You do not, you add " AddVehicleComponent(VEHICLEID, COMPONENTID); under this line to the vehicle id defined at the top, "new VEHICLE;" is one, then maybe another 1, "new VEHICLE2;" ect.

Car Component ID's

Vehicle Model ID's

well i hope it helped you. have a nice time spawning modded cars, say goodbye to stock cars!
any bugs/typo's/problems/errors please post, DO NOT POST STUPID COMMENTS LIKE MIKEP's INSULTS, GTFO if u no how to do this, dont bover saying this like " easy, too easy .. anyone can do it. " TO MANY PPL CANT look through Scripting discussion.

thankyou, Donny for making me realise what MAY happen if newbies don't understand and wish to learn what these codes actualy DO. respect+

~Cr@zY! J?e~
Reply


Messages In This Thread
[TUT]How to Tuned Car Spawns[TUT] - by gtalover12 - 10.03.2009, 22:13
Re: [TUT]How to Tuned Car Spawns[TUT] - by JaYmE - 10.03.2009, 22:17
Re: [TUT]How to Tuned Car Spawns[TUT] - by gtalover12 - 10.03.2009, 22:19
Re: [TUT]How to Tuned Car Spawns[TUT] - by Mikep - 10.03.2009, 22:19
Re: [TUT]How to Tuned Car Spawns[TUT] - by Burridge - 10.03.2009, 22:21
Re: [TUT]How to Tuned Car Spawns[TUT] - by JaYmE - 10.03.2009, 22:22
Re: [TUT]How to Tuned Car Spawns[TUT] - by Mikep - 10.03.2009, 22:23
Re: [TUT]How to Tuned Car Spawns[TUT] - by gtalover12 - 10.03.2009, 23:00
Re: [TUT]How to Tuned Car Spawns[TUT] - by Mikep - 10.03.2009, 23:14
Re: [TUT]How to Tuned Car Spawns[TUT] - by gtalover12 - 10.03.2009, 23:17

Forum Jump:


Users browsing this thread: 1 Guest(s)