06.07.2013, 07:18
(
Last edited by Aerotactics; 07/07/2013 at 03:12 AM.
)
Pre-Tuned Car Spawns
By Aerotactics
Whether you're 'brand new' to SAMP, or want to learn a new trick, this tutorial should answer your questions and explain the process and the script. While this is an easy process, it is a bit time consuming.
Requirements:
-SAMP.............................http://www.sa-mp.com/download.php
-a SAMP server.................^^Same link^^
-Multi Theft Auto (MTA).....http://www.mtavc.com/ (just click download)
If you need help starting a server, you can find it at https://sampwiki.blast.hk/wiki/Windows_Server. It's easier than it looks.
As you can see, my preferred map editor is MTA. This tutorial will explain the process using the MTA mapping tool. I know there's other tools out there, but I started using MTA before I even knew SAMP existed. Since I became comfortable with it, I used it to continue mapping in SAMP. To all the people who don't want to hear "MTA", you should be talking to the creator of convertffs.com, as I believe he intended the use of MTA as a 'Third Party Tool', and that's what I use it as. I did try to use one of those other programs, but I didn't understand how to use it, because it was different from MTA's map editor.
You may want to run through the mapping tutorial and get comfortable with the camera controls before continuing, but it isn't too hard to understand.
Step 1
First off, we are going to open MTA and enter the map editor. From here, we will start a new map and spawn our first car. In this demonstration, I will only be making one car, but you can make as many cars as you'd like. I am going to spawn a Sultan in the middle of Grove Street. This will be my tuner for this tutorial.
By double-clicking on the car, you can edit the parts and colors in this window; however, MTA car colors and SAMP colors differ entirely, so I will wait until after converting to choose my colors, which we will do after we finish our car. If you would like to add a Paintjob to your car, look at this link to see if your car has one. https://sampwiki.blast.hk/wiki/Paintjob
Step 2
Once you are finished, save the map, and exit out of MTA. Right-click the MTA icon, and choose "Open file location".
When your folder appears, click "server", "mods", "deathmatch", "resources", then find your map. Open it, then open the text document with the same name. If your computer asks, open it with Notepad.
Copy the script, and go to http://convertffs.com/ (don't exit out of the script document, but you can exit anything else). Paste the script into the box and click convert. This will convert it to SAMP (partially).
Step 3
We are now going to write a filterscript for the car (or cars). Copy the converted script from 'convertffs' and go to your SAMP server folder and open Pawno in the Pawno folder. Go to 'File', then 'New'. This will create a new blank script. You won't need most of this, so we are going to remove everything we don't need, so it looks like this (be sure to uncomment the line "#define filterscript" at the very top, otherwise our car won't appear) :
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
public OnGameModeInit()
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
new Tcar;
public OnGameModeInit()
{
AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,111,103); //Sultan
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
Step 4
Now we will tell the game what our new cars are, and give them some parts. In front of the car script "AddStaticVehicle(...)" we will type "Tcar=" to tell the game that this is our car. On the next car, you would type "Tcar2=" and so on.
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
new Tcar;
public OnGameModeInit()
{
Tcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,111,103); //Sultan
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
HTML Code:
<vehicle id="vehicle (Sultan) (2)" paintjob="2" interior="0" alpha="255" model="560" plate="PQ05 V12" dimension="0" posX="2485.69995" posY="-1667.90002" posZ="13.1" rotX="0" rotY="0" rotZ="0" upgrades="1138,1026,1033,1010,1082,1141,1169" color="111,103,95,151,149,146,0,0,0,0,0,0"></vehicle>
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
new Tcar;
public OnGameModeInit()
{
Tcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,111,103); //Sultan
AddVehicleComponent(Tcar, 1138);
AddVehicleComponent(Tcar, 1026);
AddVehicleComponent(Tcar, 1033);
AddVehicleComponent(Tcar, 1010);
AddVehicleComponent(Tcar, 1082);
AddVehicleComponent(Tcar, 1141);
AddVehicleComponent(Tcar, 1169);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
new Tcar;
public OnGameModeInit()
{
Tcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,111,103); //Sultan
AddVehicleComponent(Tcar, 1138);
AddVehicleComponent(Tcar, 1026);
AddVehicleComponent(Tcar, 1033);
AddVehicleComponent(Tcar, 1010);
AddVehicleComponent(Tcar, 1082);
AddVehicleComponent(Tcar, 1141);
AddVehicleComponent(Tcar, 1169);
ChangeVehiclePaintjob(Tcar, 2);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
Step 5
Our Cars are almost done! The last thing we have to do is make the parts reappear on the car after it respawns. This is very simple. Just copy all of your vehicle code under "OnVehicleSpawn(...)" and remove the vehicle part.
pawn Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
new Tcar;
public OnGameModeInit()
{
Tcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,111,103); //Sultan
AddVehicleComponent(Tcar, 1138);
AddVehicleComponent(Tcar, 1026);
AddVehicleComponent(Tcar, 1033);
AddVehicleComponent(Tcar, 1010);
AddVehicleComponent(Tcar, 1082);
AddVehicleComponent(Tcar, 1141);
AddVehicleComponent(Tcar, 1169);
ChangeVehiclePaintjob(Tcar, 2);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
//Sultan
AddVehicleComponent(Tcar, 1138);
AddVehicleComponent(Tcar, 1026);
AddVehicleComponent(Tcar, 1033);
AddVehicleComponent(Tcar, 1010);
AddVehicleComponent(Tcar, 1082);
AddVehicleComponent(Tcar, 1141);
AddVehicleComponent(Tcar, 1169);
ChangeVehiclePaintjob(Tcar, 2);
return 1;
}
pawn Code:
Tcar=AddStaticVehicle(560,2485.6999500,-1667.9000200,13.1000000,0.0000000,32,79); //Sultan