SA-MP Forums Archive
[FilterScript] [FS] ezConverter - Now supports CreateVehicle! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] ezConverter - Now supports CreateVehicle! (/showthread.php?tid=132047)



[FS] ezConverter - Now supports CreateVehicle! - Rzzr - 06.03.2010

ezConverter - AddStaticVehicle Converter!
by LowCo.
# About:
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); //
You want to convert these to AddStaticVehicleEx.

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); //
Step 2) Put those lines in the filterscript, i've put some comments on where to put it:
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;
}
Step 3)
On top of the script you will find this:
pawn Code:
#define Respawn_delay 500
Replace 500 with the respawn delay you want in seconds!

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.


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - aircombat - 06.03.2010

Nice One , i saw many people spamming scripting discussion if there was such converter , good work dude
________
WALTER DE'SILVA


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - Rzzr - 06.03.2010

Thanks man, i've been using it for a day and I found out it's really useful


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - aircombat - 06.03.2010

thnx again for the release and its really usefull btw
________
TEEN GIRL LIVE


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - Rzzr - 06.03.2010

Quote:
Originally Posted by Seif_
CTRL+H in pawn...
Yes but you also have to do the respawn delay then, that's what I made this for


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - Bonbon - 06.03.2010

NIce, can you make it,
The converter add at the last ,-1 ?
Thats the respawn time.
For Roleplay Script is that nice because the cars respawn only at
Server Restart and
when the Cars Explode.


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - Rzzr - 06.03.2010

Quote:
Originally Posted by Bonbon
NIce, can you make it,
The converter add at the last ,-1 ?
Thats the respawn time.
For Roleplay Script is that nice because the cars respawn only at
Server Restart and
when the Cars Explode.
Change #define Respawn_delay 500 into -1

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by LowCo.
Quote:
Originally Posted by Seif_
CTRL+H in pawn...
Yes but you also have to do the respawn delay then, that's what I made this for
Oh right. Well you can still do it with CTRL+H. Pick ); and replace it with , respawn_delay);
Guess you're right, but this might be a little bit easier. I'll make some more functions for it anyway, so it's a little bit more efficient



Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - DRIFT_HUNTER - 07.03.2010

when i convert cars output is:

AddConvertVehicleEx(562,-996222794,1139103967,1088103121,1112464740,92,60,9 0); [EXAMPLE]


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - Rzzr - 07.03.2010

Oh crap I must have made a typo then...
I will fix it!

Edit: I had a look into the script and it should work properly..


Re: [FS] vConverter - Convert AddStaticVehicle into AddStaticVehicleEx - TomTroX - 07.03.2010

Can you fix it? I will be very grateful