Pawno Text Changer?
#1

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
Reply
#2

Код:
Ctrl + H
Reply
#3

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..
Reply
#4

Make it in PHP, read a text file, then split it by ',' and place it in the correct format. Then echo it.
Reply
#5

lol... i know not how to do anything like that..
Reply
#6

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!
Reply
#7

I'd rather do that on pawn
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)