How to load maps from website
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)