SA-MP Forums Archive
How do I add vehicles to the map? - 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)
+--- Thread: How do I add vehicles to the map? (/showthread.php?tid=352337)



How do I add vehicles to the map? - JAMMIEISFTW - 19.06.2012

The /save command i get this in savedpositions.txt

AddPlayerClass(287,414.3279,2442.6599,16.5000,59.0 561,0,0,0,0,0,0); //


How would i make that a vehicle?

Say make it an infernus ( id 411 ) etc...


Re: How do I add vehicles to the map? - Mimic - 19.06.2012

AddPlayerClass and Creating a vehicle are two different things.

To make a vehicle you'll need to read this.

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx

AddStaticVehicle

https://sampwiki.blast.hk/wiki/AddStaticVehicle << This doesn't have a customer respawn timer. AddStaticVehicleEx does.

Hope I helped.

EDIT: Or this.

https://sampwiki.blast.hk/wiki/CreateVehicle


Re: How do I add vehicles to the map? - JAMMIEISFTW - 19.06.2012

Quote:

CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);

Ok so wich part is the co ordinates?


Re: How do I add vehicles to the map? - JAMMIEISFTW - 19.06.2012

Oh and how would i lock it to a certain playername?


Re: How do I add vehicles to the map? - Mimic - 19.06.2012

It tells you.

pawn Код:
(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
pawn Код:
CreateVehicle(520, X, Y, Z, ANGLE, COLOR1, COLOR2, RESPAWN);
Here is an example.

pawn Код:
CreateVehicle(411, 0.0, 0.0, 0.0, 10.0, 0, 0, 10);
That will create an Infernus, the Infernus will be spawned in the middle of San Andreas somewhere, the angle is 10.0, the color will be Black and if you exit the Infernus it will be re-spawned within 10 seconds.

This is a way to make a vehicle only be accessible via PlayerName

pawn Код:
new Mimic; //change this
pawn Код:
Mimic = CreateVehicle(modelid, X, Y, Z, ANGLE, COLOR1, COLOR2, RESPAWN); // edit this ofc
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   new PlayerName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(newstate == PLAYER_STATE_DRIVER)
   {
      new vehicle = GetPlayerVehicleID(playerid);
      if(vehicle == Mimic)
      {
          if(strcmp(PlayerName,"Mimic",true))
          {
             RemovePlayerFromVehicle(playerid);
             SendClientMessage(playerid, YOURCOLOR, "You are not allowed to enter this vehicle");
          }
     }
}



Re: How do I add vehicles to the map? - Eiy Mard - 19.06.2012

~ Moved ~


Re: How do I add vehicles to the map? - newbienoob - 19.06.2012

Just go ingame, get a car and type /save.


Re: How do I add vehicles to the map? - JAMMIEISFTW - 19.06.2012

Quote:
Originally Posted by Eiy Mard
Посмотреть сообщение
try my filtescript ... in game type /mycar .. i know there some bugs .. im lazy to fix the bugged .. haha .. so join .. the car system

download here : URL REMOVED
i'd rather not, i think this ois just advertizing.

Edit:
Quote:
Originally Posted by Eiy Mard
Посмотреть сообщение
no i dont want make advertizing ... ok .. sorry .. :/
Not meaning to sound harsh but really it seems advertizing because people tend not to install buggy things.


Re: How do I add vehicles to the map? - Eiy Mard - 19.06.2012

Quote:
Originally Posted by JAMMIEISFTW
Посмотреть сообщение
i'd rather not, i think this ois just advertizing.
no i dont want make advertizing ... ok .. sorry .. :/


Re: How do I add vehicles to the map? - JAMMIEISFTW - 19.06.2012

How would i turn

pawn Код:
AdminVehicle1 = AddStaticVehicle(470,-1769.3173,289.2891,8.4550,136.8497,43,0); //
Into an AddStaticVehicleEx?