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

Good tutorial, will help some noobies.

Reply
#3

Quote:
Originally Posted by JaYmE
Good tutorial, will help some noobies.

Well, it's not exactly for Pro's now is it?

They would probly make them drive around..
Reply
#4

I cant read half of it, prehaps remove the rainbow?

Good tutorial after I read in notepad.
Reply
#5

loools, whats with all the colors, i keep thinking im on ectasy or summing,

(look at the pretty colors)

Reply
#6

Quote:
Originally Posted by Cr@zY!_J?E
Quote:
Originally Posted by JaYmE
Good tutorial, will help some noobies.

Well, it's not exactly for Pro's now is it?

They would probly make them drive around..
Lol, i know its not for pros but i said, Some noobs as one will eventually say ' i dont getz it '
Reply
#7

Infact, reading it again, its completley useless.
Reply
#8

Quote:
Originally Posted by Mikep
Infact, reading it again, its completley useless.
mm, you ALWAYS HAVE SOMETHING TO SAY if ur not going to post anything nice, why post? no1 wants to here ur blabber gtfo.
Reply
#9

Oh forget it, im not wasting my time with morons.
Reply
#10

well, the components will add to the car before it's spawned, then a timer is needed, so it adds the components " then server takes away " then after the 1 second, adds them. tharefor you need a public.
i'm not a pro scripter or anything.. but still it works for me and my mates.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)