[Tutorial] Make cmd to auto tune vehicles
#1

Hello im just posting a usefull and easy method to make a tune command.

First off all go to "onplayercommand" then create the strcmp command
PHP Code:
if(strcmp(cmdtext"/autotune"true) == 0
Now lets start with our variables
PHP Code:
new VehicleID;
VehicleID GetPlayerVehicleID(playerid); 
Now it should like this
PHP Code:
if(strcmp(cmdtext"/autotune"true) == 0)
{
     new 
VehicleID;
     
VehicleID GetPlayerVehicleID(playerid);
     return 
1;

Now lets add a game text for players.
PHP Code:
GameTextForPlayer(playerid,"~b~Car auto modded!"40005); 
Now just need add the components with
PHP Code:
AddVehicleComponent 
here its one exaple how it should look
PHP Code:
AddVehicleComponent(VehicleID1003); //spoiler 
the code now it done and should look like this

PHP Code:
if(strcmp(cmdtext"/autotune"true) == 0)
{
            new 
VehicleID;
            
VehicleID GetPlayerVehicleID(playerid);
            
GameTextForPlayer(playerid,"~b~Car modded!"40005);
            
AddVehicleComponent(VehicleID1087); //hidraulic
            
AddVehicleComponent(VehicleID1078); // wheels
            
AddVehicleComponent(VehicleID1010); //nos 10x
            
AddVehicleComponent(VehicleID1003); //spoiler
            
AddVehicleComponent(VehicleID1018); //exaust
    
return 1;

Well enjoy modding your vehicles
Reply
#2

Good for noobs i gues..

use [pawn] Tags.. not [php]
Reply
#3

Ye, simple but nice and useful for beginers
Reply
#4

Nice tutorial
Reply
#5

Thank you
Reply
#6

This can be used maliciously. When trying to add a spoiler to a vehicle that doesn't support spoilers, the game will generate an opcode warning for everyone that has the specific vehicle streamed in. A person that spams this command can crash everyone (including himself) that is in range.
Reply
#7

how do i make it add random rims/colors?
Reply
#8

you can but it will take awhile.
Reply
#9

I tried to make this in a dialog It got 3 errors and is there any way to fix this?
Reply
#10

Don't work !

PHP Code:
if(strcmp(cmdtext"/autotune"true) == 0)
{
            new 
VehicleID;
            
VehicleID GetPlayerVehicleID(playerid);
            
GameTextForPlayer(playerid,"~b~Car modded!"40005);
            
AddVehicleComponent(VehicleID1087); //hidraulic
            
AddVehicleComponent(VehicleID1078); // wheels
            
AddVehicleComponent(VehicleID1010); //nos 10x
            
AddVehicleComponent(VehicleID1003); //spoiler
            
AddVehicleComponent(VehicleID1018); //exaust
    
return 1;

you forget "}"

PHP Code:
if(strcmp(cmdtext"/autotune"true) == 0)
{
            new 
VehicleID;
            
VehicleID GetPlayerVehicleID(playerid);
            
GameTextForPlayer(playerid,"~b~Car modded!"40005);
            
AddVehicleComponent(VehicleID1087); //hidraulic
            
AddVehicleComponent(VehicleID1078); // wheels
            
AddVehicleComponent(VehicleID1010); //nos 10x
            
AddVehicleComponent(VehicleID1003); //spoiler
}            AddVehicleComponent(VehicleID1018); //exaust
    
return 1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)