[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


Messages In This Thread
Easy Map-Including v4: Away with Objectconverters! - by PSPgamer_10 - 13.03.2011, 18:17
Re: Easy Map-Including - by [ProX]BlueFire - 13.03.2011, 20:00
Re: Easy Map-Including - by justsomeguy - 13.03.2011, 20:39
Re: Easy Map-Including - by Meinstad - 13.03.2011, 20:47
Re: Easy Map-Including - by ricardo178 - 13.03.2011, 21:02
Respuesta: Easy Map-Including - by Code8976Man - 13.03.2011, 21:04
Re: Easy Map-Including - by Davz*|*Criss - 13.03.2011, 21:29
Re: Easy Map-Including - by Ironboy - 13.03.2011, 21:30
AW: Easy Map-Including - by PSPgamer_10 - 13.03.2011, 22:12
Re: Easy Map-Including - by Jochemd - 26.03.2011, 20:34
Re: Easy Map-Including - by Edvin - 21.09.2011, 19:54
AW: Easy Map-Including - by PSPgamer_10 - 05.02.2014, 04:51

Forum Jump:


Users browsing this thread: 1 Guest(s)