SA-MP Forums Archive
[FilterScript] [FS] Simple MTA Map Loader (No more converting!) - 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] Simple MTA Map Loader (No more converting!) (/showthread.php?tid=151806)



[FS] Simple MTA Map Loader (No more converting!) - [TG]Chase - 31.05.2010

This is a very simple MTA map loader I made when I was really bored. All you have to do is download the XML plugin by Zeex, and add maploader to your filterscripts line on server.cfg, log in as RCON admin. Then you move the .map file you want to load in your scriptfiles folder, and do /loadmap [map file name]. Remember to NOT input the extension (.map). I.E, if you wanted to load a map called facility.map, you'd do /loadmap facility.

Remember that you need the XML plugin and you need to be logged in as RCON admin to use it.

Bugs: Only bug I know of, is that you may get 2 warnings of bad object IDs. That's normal and shouldn't affect your map.

Feel free to modify it to your needs, just don't remove my name.

Download (PWN + AMX)

Enjoy


Re: [FS] Simple MTA Map Loader (No more converting!) - Toni - 31.05.2010

Quote:
Originally Posted by Seif_
Does this actually work? This is pretty much what it looks like:
pawn Code:
CMD:loadmap(playerid,params[])
{
   
    new mstr[255];
    new fproc[255]
    new coord[100];
    format(mstr,255,"%s.map",params);
    new XML:mfile = xml_open(mstr);
    new File:mfile2 = fopen(mstr);
    if(fexist(mstr))
    {
        new l;
        while(fread(mfile2,fproc))
        {
           
            printf("x = %f",xml_get_float(mfile,"map/object/@posX\n"));
        }
    }
    return 1;
}
How in the world does this load a MTA map?
And Yet he doesn't even include the Inc files. Such A Shame.


Re: [FS] Simple MTA Map Loader (No more converting!) - Toni - 31.05.2010

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by Tɧ϶ Tσηί™
Quote:
Originally Posted by Seif_
Does this actually work? This is pretty much what it looks like:
pawn Code:
CMD:loadmap(playerid,params[])
{
   
    new mstr[255];
    new fproc[255]
    new coord[100];
    format(mstr,255,"%s.map",params);
    new XML:mfile = xml_open(mstr);
    new File:mfile2 = fopen(mstr);
    if(fexist(mstr))
    {
        new l;
        while(fread(mfile2,fproc))
        {
           
            printf("x = %f",xml_get_float(mfile,"map/object/@posX\n"));
        }
    }
    return 1;
}
How in the world does this load a MTA map?
And Yet he doesn't even include the Inc files. Such A Shame.
He did, I just showed what the filterscript is doing, I didn't show the whole source. The rest is pretty much including the includes.
I just tested it, Didn't Work. Tried to log into rcon and do it, didn't work, put the .map file in teh scriptfiles, main server file, all I get is SERVER: Unknown Command.


Re: [FS] Simple MTA Map Loader (No more converting!) - [TG]Chase - 01.06.2010

Shit I uploaded the wrong PWN file. Sorry guys, I'll upload the correct one.


Re: [FS] Simple MTA Map Loader (No more converting!) - [TG]Chase - 01.06.2010

Unknown command usually means you didn't run the XML plugin. The XML plugin + include, you will be able to find it here. And don't tell me you can't find the ZCMD include.


Re: [FS] Simple MTA Map Loader (No more converting!) - Toni - 01.06.2010

well that cmd worked, just that we had the wrong Pwn. 2nd - Maps are not loading, due to some sort of bug..?


Re: [FS] Simple MTA Map Loader (No more converting!) - ang12123 - 21.07.2011

where to get xml plugin?


Re: [FS] Simple MTA Map Loader (No more converting!) - linuxthefish - 21.07.2011

https://sampforum.blast.hk/showthread.php?tid=150755 should work.

I'm not sure if this even works anymore...