SA-MP Forums Archive
How to load maps from website - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to load maps from website (/showthread.php?tid=660805)



How to load maps from website - akib - 14.11.2018

Is this possible to load maps from a specified website like pastebin or website.com/maps.txt

I tried with HTTP function but i can't load the maps...

Please help me on this


Re: How to load maps from website - khRamin78 - 14.11.2018

first the texts should be totally defined as pawn normal filterscript methods

then you need to compile the filterscript [selfmade c++ script would be needed to auto compile the script loaded]

and then you can read that filterscript from server

so it has long way if you realy need that happen you can do this way only


but i think just copy/pasting the codes in a .pwn file and then making it a filterscript would be much esaier
all thing you have to do is just do /rcon loadfs <fs name>


Re: How to load maps from website - dotSILENT - 14.11.2018

You can write your own file parsing code to load objects from files. I use sscanf for parsing the lines, like that:
PHP код:
if(!strcmp(funcName"CreateDynamicObject") && paramLen)
{
    if(
sscanf(funcParams"p<,>dffffffD(-1)D(-1){D(-1)}F(-1.0)F(-1.0)D(-1)D(0)"modelidposXposYposZrotXrotYrotZworldidinterioridstreamDistdrawDistareaidpriority))
        continue;
    if(
drawDist == -1.0)
        
drawDist gDrawDist;
    if(
streamDist == -1.0)
        
streamDist gStreamDist;
    if(
worldid == -1)
        
worldid gVW;
    if(
interiorid == -1)
        
interiorid gInterior;
    if(
priority == 0)
        
priority gPriority;
    
tempObjID CreateDynamicObject(modelidposX+gOffset[0], posY+gOffset[1], posZ+gOffset[2], rotXrotYrotZworldidinteriorid, -1streamDistdrawDistareaidpriority); 
Creating your own parser is very useful in some cases, as you can create your own 'functions', I have a few of them. For example setting the VW for all objects is as simple as writing
PHP код:
setVW(100); 
same goes for setting streaming/draw distances, priorities etc. I also have a setOffset(x,y,z) func which allows me to move entire maps by an offset I choose.