Pawno Text Changer? -
Kevin_Joshen - 17.08.2010
Hello.
I am converting my houses (all 998 of them) from a format like this:
Код:
AH(74, -2654.0259,190.3699,4.3281, 235.508994,1189.169897,1080.339966, 6243423, 0, 3);
to a format like this:
Код:
CreateHouse("Omega Mansion", 1000000, -2654.0259,190.3699,4.3281, 235.508994,1189.169897,1080.339966, 3, 900000);
If anyone could reccomend a converter, or something.... I would be SO thankful! because if I do it the long way.... who knows how long that could take.
Thank you!
-Kevin
Proud Owner of The Crazy Awesome Franchise.
Crazy Awesome ||DM||Stunt||Fun||
Crazy Awesome Cops n' Robbers
Re: Pawno Text Changer? - [L3th4l] - 17.08.2010
Re: Pawno Text Changer? -
Kevin_Joshen - 17.08.2010
I know that one... but i mean.. like when you convert maps. there is a option to convert to incognitos streamer.. i was wondering if there was one that would change it to the "CreateHouse" format.. you know.. with price first.. then xyz, then intxyz, then, so on and so on..
Re: Pawno Text Changer? -
lolumadd - 17.08.2010
Make it in PHP, read a text file, then split it by ',' and place it in the correct format. Then echo it.
Re: Pawno Text Changer? -
Kevin_Joshen - 17.08.2010
lol... i know not how to do anything like that..
Re: Pawno Text Changer? -
lolumadd - 17.08.2010
Here is the code in PHP
Код:
<?php
$filename = "file.txt";
$lines = file($filename);
$template = "CreateHouse("; //lame way of doing it
foreach ($lines as $line_num => $line)
{
$blah = split(",",$line); //if you plan on using this in php v6(upcoming release) this function is removed..
$template = $template."".$blah[3].",".$blah[4].",".$blah[5].",".$blah[0].",".$blah[1].",".$blah[2].");<br>";
}
echo $template;
?>
//eg. AH(x,y,z,intx,inty,intz); to AddHouse(intx,inty,intz,x,y,z,);
That will switch the x,y,z params from the front of the cmd to the back using the converter. To add more params is quite easy, just follow what Ive done and add it it. you may need to think a bit when switching the params because it might become confusing.
To convert:
save the code above the convert.php
in the same directory, put all of the AH in file.txt
go to localhost/convert.php and that is your code.
Have fun!
Re: Pawno Text Changer? -
wups - 17.08.2010
I'd rather do that on pawn
Re: Pawno Text Changer? -
ikey07 - 17.08.2010
Do it by server
read old House system, and write to new file all lines in new format
like you savehouses now , just change format