[Include] Easy Map-Including
#1

  • What is Easy Map Including?
    This is the Script wich gives an end to all these Map-converters and weird stuff like this. You can bind all your MTA, MTA Race and also SAMP maps with just one Function: 'LoadMap("FILENAME.map"); '.

  • How does it work?
    First off, you must create a Folder in your "scriptfiles"-Folder named as "maps". Then, copy your .map-Files in the "maps"-Folder, without changing anything in it (just copy it from your MTA folder to the 'maps' folder)! Then, you write on the top of your Script under '#include <a_samp>' this: '#include <mapincluding>'. And don't forget to write "RemoveWorldObjects(playerid);" under OnPlayerConnect so the World objects you removed in MTA will be removed in SAMP, too. Then, you load the map you want in "OnGameModeInit" (or somewhere else if you want), with the "LoadMap(mapfile[]);" Function.

  • What is new in v4?
    UnloadMap: I deleted the UnloadMap function, it was bugged. I will write the whole Script again with better Codes, there I will script it again.
    Tuning & Components: The components you added to a Vehicle in MTA will be converted too.
    Removed World objects: The World Objects you removed in MTA will be removed in SAMP too, just don't forget to write "RemoveWorldObjects(playerid);" under OnPlayerConnect.
  • Mapconverter
    If you want to convert your Maps and add the Lines to OnGameModeInit and load it this way instead of loading it as a File, i would respect that.
    That's why i made the Function " ConvertMap("FILENAME.map"); "!
    With this new Function, you can convert MTA 1.0, MTA DM and MTA Race maps to SAMP Maps.
    When u use this Function, there will be created a new File in your "scriptfiles" Folder with the converted Map.
    The Filename of the converted map will be "OUT_<original_filename>.map".

  • Streamersupport!
    If you want to use a Streamer, you just must do this:
    First off, you must open the Script in wich you included the Include, and create 2 Callbacks (public-Functions) and spawn the Vehicles/Maps manually by your own CreateObject/CreateVehicle Function:
    pawn Код:
    public OnObjectDataLoad(modelid,Float:posX,Float:posY,Float:posZ,Float:rotX,Float:rotY,Float:rotZ,Float:drawdistance)
    {//For Map-conversions
        CreateDynamicObject(modelid,posX,posY,posZ,rotX,rotY,rotZ,drawdistance); //the function depends on what streamer you use, this is just an example..
        return 1;
    }

    public OnVehicleDataLoad(vehicletype,Float:x,Float:y,Float:z,Float:rotation,interior,color1,color2,respawn_delay,paintjob,numberplate[],vcomp1,vcomp2,vcomp3,vcomp4,vcomp5,vcomp6,vcomp7,vcomp8,vcomp9,vcomp10,vcomp11,vcomp12,vcomp13,vcomp14)
    {//For Vehicle conversions
        CreateVehicle(vehicletype,x,y,z,rotation,color1,color2,respawn_delay);
        return 1;
    }
    Like i said, the Function you use to spawn the Vehicles/create the objects is dependent from the Streamer you use.
    As example, if you use Incognito's Objectstreamer you must use the "CreateDynamicObject" Function to create the Map.

    And one more important thing, that i must tell you:
    You must NOT use the "OnVehicleDataLoad" Callback. If you delete the Function and don't use it, the converted Vehicles will be created with the standart "CreateVehicle"-Function. The same applies for Objects. If you don't use OnObjectDataLoad, the converted Objects will be converted with the standart "CreateObject" Function.

    Important Note.: If you convert Vehicles wich are mapped with MTA 1.4, the paintjobs, interiors and numberplate will be converted with the vehicle, too. I recommend you to change the Vehicles paintjob, numberplate and interior under "OnVehicleDataLoad".
    If the Vehicle is not mapped with MTA 1.4, the Interior-variable is '0', Paintjob-variable is '3' (3=no paintjob).

  • Next Version: v5 Final!
    You know, i did everything what i can with this Include: Maploader, Map-Unloader, Mapconverter... And thats why v5 will be the Final version of this Include.
    And like I said, I will write the whole Script again for better codes and more stability.
    I'm open for your suggestions and Bugreports, just let me know what you want for v4 Final so i can do it for you.

  • Download
    Show mapincluding.inc - pastebin.com

  • Closeword
    Like I said, you MUST create the Folder "maps" in the 'scriptfiles' Folder, otherwise your Script could crash while loading the Map.
    I'm open for your Bugreports and Suggestions for v5!
Peace.
Reply
#2

cool...
very useful for me =D
Reply
#3

wow this could only be more perfect if it had a build in streamer!XD
Reply
#4

Wow, once again you make something awsome! I have to say awesome awesome awesome!
Reply
#5

Just GREAT and USEFULL!
Reply
#6

Woww, thats very nice and useful. Awesome job, thanks.
Reply
#7

Godlike aw aw aw
Reply
#8

Good work!
Reply
#9

Thank you all ^^
And yes, the Streamersupport and a Build-in Streamer will come with v2.
Reply
#10

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
wow this could only be more perfect if it had a build in streamer!XD
You can change it in the include..
Reply
#11

WOW, this is a really nice include...if you have 2 maps and same location you can use this function to enable/disable the maps... Good Job i will use it
Reply
#12

The URL's are now updated.
Thanks for all the one who made me know per PM that the Links doesn't work anymore.
You can use it.

I am open for your Suggestions.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)