[Tutorial] Making vehicle components [ONLY A_SAMP INC NEEDED]
#1

Hi all, this is my first tutorial so dont expect to much.
In this tutorial im going to explain you some stuff about vehicle components.

Usefull to have:
https://sampwiki.blast.hk/wiki/Car_Component_ID // This is needed if you wanna add some components.

Lets start with a basic thing.
AddVehicleComponent is a function wich adds pimps to vehicles. If i want gold wheels on every car wich possible, i can make a command like this:

pawn Code:
if(!strcmp(cmdtext, "/goldenwheels", true))
        AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
        SendClientMessage(playerid, -1, "Your vehicle has golden rims!");
        return 1;
    }
If i in-game typ /goldenwheels, my car will get golden rims and i get the message: "Your vehicle has golden rims!"

In white color, so if somebody uses this command, his car get golden rims and you get the message wich i said above.

If i wanna add NOS to every vehicle we can make this command:


pawn Code:
if(!strcmp(cmdtext, "/nos", true))
        AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
        SendClientMessage(playerid, -1, "Your vehicle has 10x NOS!");
        return 1;
    }
Now the person who uses /nos gets 10x NOS in his car, and will get a message: "Your vehicle has 10x NOS!" in white color.

pawn Code:
AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
This part of script adds the NOS at /nos. You can easely edit it. Look the link i posted above.
here you can find car parts and their ID. 1010 is the ID from 10x NOS.

I hope this tutorial helped a bit. First i didn't knew about "AddVehicleComponent" but i found it out a bit and wanted to share.
Reply
#2

Really, you didnt explaine nothing..
Reply
#3

Oh really?

Quote:

AddVehicleComponent is a function wich adds pimps to vehicles. If i want gold wheels on every car wich possible, i can make a command like this:

This is what i explained. A part of it...
Reply
#4

Oh Thanks!
Really useful!
I'll release filescript for tuning of cars!
+1 Rep.
Reply
#5

Quote:
Originally Posted by Hade.
View Post
Really, you didnt explaine nothing..
Then you probably didn't read it enough. I read it and got some information out of it. Thanks mate.
Reply
#6

Quote:
Originally Posted by Mr.Anonymous
View Post
Then you probably didn't read it enough. I read it and got some information out of it. Thanks mate.
Thanks you learned something from it.


Quote:
Originally Posted by theomanking
Oh Thanks!
Really useful!
I'll release filescript for tuning of cars!
+1 Rep.
Thanks . I hope i can help more people with it.

I made a mistake in it, not all vehicles get golden rims. Only the vehicle wich you are in.
Reply
#7

Good job, thought I think you can update this with more commands!
Reply
#8

Quote:
Originally Posted by Bikken
View Post
Good job, thought I think you can update this with more commands!
I will add some more info soon. Thanks ^,^
Reply
#9

this is shit no offence
Reply
#10

Quote:
Originally Posted by Hade.
View Post
Really, you didnt explaine nothing..
I've to agree. This is more of copy-paste than a tutorial.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)