SA-MP Forums Archive
[Help] Spawning Moddded Cars - 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: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Spawning Moddded Cars (/showthread.php?tid=115428)



[Help] Spawning Moddded Cars - fsnameless - 24.12.2009

like this car i got this code from the ladmin script i use
pawn Код:
carid = CreateVehicle(541,X,Y,Z,Angle,1,-1,-1);
PutPlayerInVehicle(playerid,carid,0);
CMDMessageToAdmins(playerid,"LTunedCar");
AddVehicleComponent(carid,1092);
 AddVehicleComponent(carid,1166);
AddVehicleComponent(carid,1165);
AddVehicleComponent(carid,1090);
AddVehicleComponent(carid,1094);
AddVehicleComponent(carid,1010);
AddVehicleComponent(carid,1087);
AddVehicleComponent(carid,1163);//SPOILER
AddVehicleComponent(carid,1091);
ChangeVehiclePaintjob(carid,2);
i want to make that a static vehicle is it possible?


Re: [Help] Spawning Moddded Cars - [HiC]TheKiller - 24.12.2009

pawn Код:
AddStaticVehicle(541, X, Y, Z,Angle, -1, -1);
https://sampwiki.blast.hk/wiki/AddStaticVehicle


Re: [Help] Spawning Moddded Cars - fsnameless - 24.12.2009

i know how to add statics i mean can i make it a static with the AddComponents


Re: [Help] Spawning Moddded Cars - MadeMan - 24.12.2009

You can't make static modded cars, you need to AddVehicleComponent every time vehicle spawns.


Re: [Help] Spawning Moddded Cars - Niixie - 24.12.2009

Or

pawn Код:
OnGameModeInit()
{
    Tunedcar = CreateVehicle(541,X,Y,Z,Angle,1,-1,-1)
    AddVehicleComponent(carid,1092);
    AddVehicleComponent(carid,1166);
    AddVehicleComponent(carid,1165);
    AddVehicleComponent(carid,1090);
    AddVehicleComponent(carid,1094);
    AddVehicleComponent(carid,1010);
    AddVehicleComponent(carid,1087);
    AddVehicleComponent(carid,1163);//SPOILER
    AddVehicleComponent(carid,1091);
    ChangeVehiclePaintjob(carid,2);
    return 1;
}
Just get the coords of the place the car should spawn then replace it with the X,Y,Z,Angle


Re: [Help] Spawning Moddded Cars - Cedimedi - 24.12.2009

Quote:
Originally Posted by Niixie
Or

pawn Код:
OnGameModeInit()
{
   Tunedcar = CreateVehicle(541,X,Y,Z,Angle,1,-1,-1);  
   AddVehicleComponent(carid,1092);
   AddVehicleComponent(carid,1166);
   AddVehicleComponent(carid,1165);
   AddVehicleComponent(carid,1090);
   AddVehicleComponent(carid,1094);
   AddVehicleComponent(carid,1010);
   AddVehicleComponent(carid,1087);
   AddVehicleComponent(carid,1163);//SPOILER
   AddVehicleComponent(carid,1091);
   ChangeVehiclePaintjob(carid,2);
   return 1;
}
Just get the coords of the place the car should spawn then replace it with the X,Y,Z,Angle
Yea this work, but then after the vehicle exploded and respawn it won't be modded again...




Re: [Help] Spawning Moddded Cars - MadeMan - 24.12.2009

Quote:
Originally Posted by (ed!med!
Quote:
Originally Posted by Niixie
Or

pawn Код:
OnGameModeInit()
{
   Tunedcar = CreateVehicle(541,X,Y,Z,Angle,1,-1,-1);  
   AddVehicleComponent(carid,1092);
   AddVehicleComponent(carid,1166);
   AddVehicleComponent(carid,1165);
   AddVehicleComponent(carid,1090);
   AddVehicleComponent(carid,1094);
   AddVehicleComponent(carid,1010);
   AddVehicleComponent(carid,1087);
   AddVehicleComponent(carid,1163);//SPOILER
   AddVehicleComponent(carid,1091);
   ChangeVehiclePaintjob(carid,2);
   return 1;
}
Just get the coords of the place the car should spawn then replace it with the X,Y,Z,Angle
Yea this work, but then after the vehicle exploded and respawn it won't be modded again...

Yes, so you should use OnVehicleSpawn callback.


Re: [Help] Spawning Moddded Cars - fsnameless - 24.12.2009

Thanks Guys Just What I Needed =)


Re: [Help] Spawning Moddded Cars - fsnameless - 24.12.2009

Well its Works But Now Its Not The Right Car...
the Cmd Is in the first post but this is the car it makes


the cmd makes the purple car but the spawning makes the bullet
and i dont know what car it is




Re: [Help] Spawning Moddded Cars - [HiC]TheKiller - 24.12.2009

pawn Код:
OnVehicleSpawn(vehicleid)
{
  AddVehicleComponent(.....)
  return 1;
}