SA-MP Forums Archive
[Tutorial] Making vehicle components [ONLY A_SAMP INC NEEDED] - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Making vehicle components [ONLY A_SAMP INC NEEDED] (/showthread.php?tid=414772)



Making vehicle components [ONLY A_SAMP INC NEEDED] - [WA]iRonan - 10.02.2013

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.



Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - Hade. - 10.02.2013

Really, you didnt explaine nothing..


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - [WA]iRonan - 10.02.2013

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...


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - theomanking - 10.02.2013

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


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - Mr.Anonymous - 10.02.2013

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.


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - [WA]iRonan - 11.02.2013

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.


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - Bikken - 11.02.2013

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


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - [WA]iRonan - 12.02.2013

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 ^,^


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - YoungKris - 18.02.2013

this is shit no offence


Re: Making vehicle components [ONLY A_SAMP INC NEEDED] - Konstantinos - 26.10.2013

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.