[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)