[Tutorial] [TUT]How to spawn tuned car
#1

Hello there this is my first tutorial
I didnt found this kind of tutorial anywhere so i said i will make my own...

Here we go...

first we need to add variable

Код:
new mycar;
then we need to add our car and give a "name" so the server will know which car to spawn tuned
This code will spawn a sultan near LV fight club.
Код:
mycar= AddStaticVehicle(560,2120.3489,2184.1875,10.3771,2.0218,17,1);
now we need to add vehicle's components.You can find vehicle components at wiki samp.

This here will add our vehicle x10nitro
Код:
AddVehicleComponent(mycar, 1010);
we finished our tuned car now,it will spawn our sultan with x10nitro.

Here is another example:
Код:
  new mycar;
  
  OnGameModeInit();
  mycar = AddStaticVehicle(560,2120.3489,2184.1875,10.3771,2.0218,17,1); //vehicle = Sultan
  AddVehicleComponent(mycar, 1010); 
  AddVehicleComponent(mycar, 1026);
  AddVehicleComponent(mycar, 1027);
  AddVehicleComponent(mycar, 1028);
  AddVehicleComponent(mycar, 1029);
  AddVehicleComponent(mycar, 1030);
  AddVehicleComponent(mycar, 1031);
  AddVehicleComponent(mycar, 1032);
  AddVehicleComponent(mycar, 1033);
  AddVehicleComponent(mycar, 1138);
  AddVehicleComponent(mycar, 1139);
  AddVehicleComponent(mycar, 1140);
  AddVehicleComponent(mycar, 1141);
  AddVehicleComponent(mycar, 1169);
  AddVehicleComponent(mycar, 1170);
This example makes our sultan fully tuned!



I hope you like it !



Reply
#2

Then i saw thread, i think it's gonna be something with car's saving and loading. But... Well, script will work, but you can to explain it more. :]
Reply
#3

AddVehicleComponent max ~ 9-10.

See for yourself TunnedCarInfoCmds

and:
pawn Код:
new TuningID[] = {1010, 1029, 1031, 1033, 1139, 1141, 1170}; // Nitro10, Exhaust, Sideskirt, Roof, Spoiler, Rear Bumper, Front Bumper
for(new i; i < sizeof TuningID; i++)
{
    AddVehicleComponent(mycar, TuningID[i]);
}
Reply
#4

Nice!! D
Reply
#5

Hmm well short, but okey.
Reply
#6

Nice tutorial.
Reply
#7

C:\Users\niels\Desktop\samp\filterscripts\CarSF.pw n(23) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
------------------
CreateVehicle(558,-1896.30004883,246.30000305,40.79999924,220.0000000 0,1,1,15); //Uranus
AddVehicleComponent(1169); //object (fbmp_a_s) (1)

----------------



dont get it
im new with Pawn scripting so help please
Reply
#8

new mycar;

then on "gamemodeinit"

mycar = CreateVehicle(558,-1896.30004883,246.30000305,40.79999924,220.0000000 0,1,1,15); //Uranus
AddVehicleComponent(mycar, 1169); //object (fbmp_a_s) (1)

------------------------------------------------------------------
Maybe to try....like in tutorial ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)