SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Tools and Files (https://forum.sa-mp.com/forumdisplay.php?f=82)
-   -   [Tool/Web/Other] .pwn to .tde (iPleomax TD Editor) (https://forum.sa-mp.com/showthread.php?t=603568)

Seregamil1 25/03/2016 04:20 AM

.pwn to .tde (iPleomax TD Editor)
 
Converts this
PHP Code:

//Global Textdraws:

new Text:Textdraw0;
new 
Text:Textdraw1;
new 
Text:Textdraw2;


Textdraw0 TextDrawCreate(130.2489774.666663"Ammuniton:");
TextDrawLetterSize(Textdraw00.2279200.899999);
TextDrawAlignment(Textdraw01);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw00);
TextDrawSetOutline(Textdraw01);
TextDrawBackgroundColor(Textdraw051);
TextDrawFont(Textdraw02);
TextDrawSetProportional(Textdraw01);

Textdraw1 TextDrawCreate(125.689620, -0.250007"usebox");
TextDrawLetterSize(Textdraw10.0000007.645375);
TextDrawTextSize(Textdraw1121.6896050.000000);
TextDrawAlignment(Textdraw11);
TextDrawColor(Textdraw10);
TextDrawUseBox(Textdraw1true);
TextDrawBoxColor(Textdraw1, -2139062017);
TextDrawSetShadow(Textdraw10);
TextDrawSetOutline(Textdraw10);
TextDrawFont(Textdraw10);

Textdraw2 TextDrawCreate(640.59478773.833305"usebox");
TextDrawLetterSize(Textdraw20.000000, -0.476675);
TextDrawTextSize(Textdraw2, -1.5314500.000000);
TextDrawAlignment(Textdraw21);
TextDrawColor(Textdraw20);
TextDrawUseBox(Textdraw2true);
TextDrawBoxColor(Textdraw2, -2139062017);
TextDrawSetShadow(Textdraw20);
TextDrawSetOutline(Textdraw20);
TextDrawFont(Textdraw20);


//Player Textdraws:

new PlayerText:Textdraw0[MAX_PLAYERS];
new 
PlayerText:Textdraw1[MAX_PLAYERS];
new 
PlayerText:Textdraw2[MAX_PLAYERS];


Textdraw0[playerid] = CreatePlayerTextDraw(playerid156.54911819.666666"Minigun: ~r~~h~None");
PlayerTextDrawLetterSize(playeridTextdraw0[playerid], 0.2279200.899999);
PlayerTextDrawAlignment(playeridTextdraw0[playerid], 1);
PlayerTextDrawColor(playeridTextdraw0[playerid], -1);
PlayerTextDrawSetShadow(playeridTextdraw0[playerid], 0);
PlayerTextDrawSetOutline(playeridTextdraw0[playerid], 1);
PlayerTextDrawBackgroundColor(playeridTextdraw0[playerid], 51);
PlayerTextDrawFont(playeridTextdraw0[playerid], 2);
PlayerTextDrawSetProportional(playeridTextdraw0[playerid], 1);

Textdraw1[playerid] = CreatePlayerTextDraw(playerid156.61207533.500000"Rocket launcher: ~g~~h~~h~3");
PlayerTextDrawLetterSize(playeridTextdraw1[playerid], 0.2279200.899999);
PlayerTextDrawAlignment(playeridTextdraw1[playerid], 1);
PlayerTextDrawColor(playeridTextdraw1[playerid], -1);
PlayerTextDrawSetShadow(playeridTextdraw1[playerid], 0);
PlayerTextDrawSetOutline(playeridTextdraw1[playerid], 1);
PlayerTextDrawBackgroundColor(playeridTextdraw1[playerid], 51);
PlayerTextDrawFont(playeridTextdraw1[playerid], 2);
PlayerTextDrawSetProportional(playeridTextdraw1[playerid], 1);

Textdraw2[playerid] = CreatePlayerTextDraw(playerid156.67503347.333328"Mine launcher: ~g~~h~~h~1");
PlayerTextDrawLetterSize(playeridTextdraw2[playerid], 0.2279200.899999);
PlayerTextDrawAlignment(playeridTextdraw2[playerid], 1);
PlayerTextDrawColor(playeridTextdraw2[playerid], -1);
PlayerTextDrawSetShadow(playeridTextdraw2[playerid], 0);
PlayerTextDrawSetOutline(playeridTextdraw2[playerid], 1);
PlayerTextDrawBackgroundColor(playeridTextdraw2[playerid], 51);
PlayerTextDrawFont(playeridTextdraw2[playerid], 2);
PlayerTextDrawSetProportional(playeridTextdraw2[playerid], 1); 

to this

PHP Code:

130.248977|4.666663|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|0|Ammuniton:
156.549118|19.666666|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Minigun: ~r~~h~None
156.612075
|33.500000|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Rocket launcher: ~g~~h~~h~3
156.675033
|47.333328|0.227920|0.899999|0.000000|0.000000|1|-1|0|0|0|1|51|2|1|0|1|Ammuniton:
125.689620|-0.250007|0.000000|7.645375|121.689605|0.000000|1|0|1|-2139062017|0|0|0|0|0|0|0|usebox
640.594787
|73.833305|0.000000|-0.476675|-1.531450|0.000000|1|0|1|-2139062017|0|0|0|0|0|0|0|usebox 

Run the application
Enter the path to the file
Press 'Enter'

Source code
PHP Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.IO;
using System.Text.RegularExpressions;

namespace 
ipleomax
{
    class 
Program
    
{
        public static 
string iPositionX "0.000000";
        public static 
string iPositionY "0.000000";
        public static 
string iLetterX "0.000000";
        public static 
string iLetterY "0.000000";
        public static 
string iTextX "0.000000";
        public static 
string iTextY "0.000000";
        public static 
string iAlignment "0";
        public static 
string iColor "0";
        public static 
string iUsebox "0";
        public static 
string iBoxcolor "0";
        public static 
string iShadow "0";
        public static 
string iOutline "0";
        public static 
string iBackgroundcolor "0";
        public static 
string iFont "0";
        public static 
string iProportion "0";
        public static 
string iSelectable "0";
        public static 
string iType "0";
        public static 
string iText "0";

        static 
void Main(string[] args)
        {
            
Console.WriteLine("Enter path to file");
            
string path Console.ReadLine();

            
using (StreamReader fRead = new StreamReader(pathEncoding.GetEncoding("windows-1251")))
            {
                
using (StreamWriter fWrite = new StreamWriter(path ".tde"false))
                {
                    
string line string.Empty;

                    
Regex integer = new Regex(@"\b(\d+)|-\b(\d+)");
                    
Regex doubles = new Regex(@"(?:\d{1,6})?(?:\.\d{1,6})|-(?:\d{1,6})?(?:\.\d{1,6})");
                    
Regex quote = new Regex("\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"");
                    
Regex bracket = new Regex(@"\(.+\)");

                    
MatchCollection collection;

                    
bool key false;

                    while (!
fRead.EndOfStream)
                    {
                        
line fRead.ReadLine();

                        if (
line.Length == 0)
                        {
                            if (
key == false)
                                continue;

                            
string resultLine string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}",
                                
iPositionXiPositionYiLetterX,
                                
iLetterYiTextXiTextY,
                                
iAlignmentiColoriUsebox,
                                
iBoxcoloriShadowiOutline,
                                
iBackgroundcoloriFontiProportion,
                                
iSelectableiTypeiText );

                            
fWrite.WriteLine(resultLine);
                            
Console.WriteLine(resultLine);

                            
iPositionX "0.000000";
                            
iPositionY "0.000000";
                            
iLetterX "0.000000";
                            
iLetterY "0.000000";
                            
iTextX "0.000000";
                            
iTextY "0.000000";
                            
iAlignment "0";
                            
iColor "0";
                            
iUsebox "0";
                            
iBoxcolor "0";
                            
iShadow "0";
                            
iOutline "0";
                            
iBackgroundcolor "0";
                            
iFont "0";
                            
iProportion "0";
                            
iSelectable "0";
                            
iType "0";
                            
iText "0";
                            
key false;
                        }

                        if (
line.Contains("TextDrawCreate") || line.Contains("CreatePlayerTextDraw"))
                        {
                            
key true;
                            
line bracket.Match(line).Value;
                            
iText quote.Match(line).Value;
                            
collection doubles.Matches(line);

                            
iPositionX collection[0].Value;
                            
iPositionY collection[1].Value;

                            
iType = ((line.Contains("playerid") ? "1" "0"));
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawLetterSize") || line.Contains("PlayerTextDrawLetterSize"))
                        {
                            
line bracket.Match(line).Value;

                            
collection doubles.Matches(line);

                            
iLetterX collection[0].Value;
                            
iLetterY collection[1].Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawTextSize") || line.Contains("PlayerTextDrawTextSize"))
                        {
                            
line bracket.Match(line).Value;

                            
collection doubles.Matches(line);

                            
iTextX collection[0].Value;
                            
iTextY collection[1].Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawAlignment") || line.Contains("PlayerTextDrawAlignment"))
                        {
                            
line bracket.Match(line).Value;

                            
iAlignment integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawColor") || line.Contains("PlayerTextDrawColor"))
                        {
                            
line bracket.Match(line).Value;

                            
iColor integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawUseBox") || line.Contains("PlayerTextDrawUseBox"))
                        {
                            
line bracket.Match(line).Value;

                            
iUsebox = (line.Contains("true") ? "1" "0");//integer.Match(line).Value;
                            
continue;
                        }
                        
                        if (
line.Contains("TextDrawBoxColor") || line.Contains("PlayerTextDrawBoxColor"))
                        {
                            
line bracket.Match(line).Value;

                            
iBoxcolor integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetShadow") || line.Contains("PlayerTextDrawSetShadow"))
                        {
                            
line bracket.Match(line).Value;

                            
iShadow integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetOutline") || line.Contains("PlayerTextDrawSetOutline"))
                        {
                            
line bracket.Match(line).Value;

                            
iOutline integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawBackgroundColor") || line.Contains("PlayerTextDrawBackgroundColor"))
                        {
                            
line bracket.Match(line).Value;

                            
iBackgroundcolor integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawFont") || line.Contains("PlayerTextDrawFont"))
                        {
                            
line bracket.Match(line).Value;

                            
iFont integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetProportional") || line.Contains("PlayerTextDrawSetProportional"))
                        {
                            
line bracket.Match(line).Value;

                            
iProportion integer.Match(line).Value;
                            continue;
                        }
                        
                        if (
line.Contains("TextDrawSetSelectable") || line.Contains("PlayerTextDrawSetSelectable"))
                        {
                            
line bracket.Match(line).Value;

                            
iSelectable integer.Match(line).Value;
                            continue;
                        }
                    }
                }
            }
            
Console.Read();
        }

    }


http://rghost.ru/6hMRyPWqn

Max_Andolini 25/03/2016 09:31 AM

Re: .pwn to .tde (iPleomax TD Editor)
 
Good job.

Roozevelt 25/03/2016 09:45 AM

Re: .pwn to .tde (iPleomax TD Editor)
 
OMG , can't understand anything :/

Jimmmy 27/03/2016 04:39 AM

Re: .pwn to .tde (iPleomax TD Editor)
 
Very good :)

HaRdiiZin 27/03/2016 06:36 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
Ohh good :)

LaLy17 27/03/2016 07:13 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
Don't work. :/

HydraHumza 05/04/2016 02:11 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
Will be awesome if you create a video or post screenshot how it actually works.

wampiros6 06/04/2016 03:58 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
it don't work with tdeditor. It show me error.

SecretBoss 06/04/2016 08:41 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
Can you add the option to save the file somewhere? It's very boring to copy all this code

legendd 08/05/2016 04:47 PM

Re: .pwn to .tde (iPleomax TD Editor)
 
good job, great work


All times are GMT. The time now is 12:56 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.