06.03.2010, 10:50
ezConverter - AddStaticVehicle Converter!
by LowCo.
# About:by LowCo.
I was looking for something to convert AddStaticVehicle code into AddStaticVehicleEx. However, I couldn't find anything so I made this.
A version for converting is now out!
This might be a little inefficient, if you know something to make it more efficient, don't hesitate to post a reply!
(A Dutch version of this thread can be found here: http://forum.sa-mp.com/index.php?topic=157313.0)
# How it works:
I will explain:
Let's say you just saved some vehicles and you have this code:
pawn Code:
AddStaticVehicle(442,-2042.8380,1104.2616,53.1179,92.2108,11,105); //
AddStaticVehicle(442,-2040.3892,1116.0852,53.1224,271.0554,25,109); //
AddStaticVehicle(415,-2060.0271,1103.0707,53.1032,91.9802,25,1); //
AddStaticVehicle(468,-2060.3682,1113.4735,52.9576,88.5125,46,46); //
AddStaticVehicle(513,1532.1505,-1359.5892,330.0145,104.9421,21,36); //
Step 1) Use ctrl+H in pawno and replace AddStaticVehicle( with the type you want. replace it with ConvertType1( to convert to AddStaticVehicleEx and replace it with ConvertType2( to convert to CreateVehicle.
PLEASE NOTE: If you do not use the ( in AddStaticVehicle( the script will mess up if you click Replace All!
If we want to convert to AddStaticVehicleEx the output will be:
pawn Code:
ConvertType1(442,-2042.8380,1104.2616,53.1179,92.2108,11,105); //
ConvertType1(442,-2040.3892,1116.0852,53.1224,271.0554,25,109); //
ConvertType1(415,-2060.0271,1103.0707,53.1032,91.9802,25,1); //
ConvertType1(468,-2060.3682,1113.4735,52.9576,88.5125,46,46); //
ConvertType1(513,1532.1505,-1359.5892,330.0145,104.9421,21,36); //
It should look like this:
pawn Code:
public OnFilterScriptInit()
{
print("\n __________________________________________________");
print(" Vehicle Converter by LowCo Initializing\n");
// Input your code here:
//--------------------------------------------------------------------------
ConvertType1(442,-2042.8380,1104.2616,53.1179,92.2108,11,105); //
ConvertType1(442,-2040.3892,1116.0852,53.1224,271.0554,25,109); //
ConvertType1(415,-2060.0271,1103.0707,53.1032,91.9802,25,1); //
ConvertType1(468,-2060.3682,1113.4735,52.9576,88.5125,46,46); //
ConvertType1(513,1532.1505,-1359.5892,330.0145,104.9421,21,36); //
//--------------------------------------------------------------------------
print("\n All vehicles converted into ezconverter.txt!");
return 1;
}
On top of the script you will find this:
pawn Code:
#define Respawn_delay 500
Step 4) Hit compile, close the file and run the server.
Step 5) Exit the server and open scriptfiles/ezconverter.txt, you will find you AddStaticVehicleEx/CreateVehicle code there
# Installing:
1) Compile the file from Pastebin.
2) Open your server.cfg file and add ezconverter to your filterscripts line
3) See How it works above for further explaination
# New:
Version 1.1, now able to convert to CreateVehicle.
# Downloads:
Pastebin - http://pawn.pastebin.com/NRsUymDN
# Credits:
LowCo (me).
If you have a suggestion on how to make it more efficient, please post a reply.
I hope it's useful and have fun with it!
LowCo.