![]() |
#1 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,423
Reputation: 626
|
![]() MTA -> SA-MP Map converter This is a map converter plugin which purpose is converting maps from MTA to SAMP as easy as possible. You can just drag'n'drop your MTA maps, even folder containing maps to scriptfiles\maps\MTA and start the server. With this converter you can load map to your server. You can even of course unload it, and convert it. For a deeper knownledge see MapConverter.pwn. Supported elements:
Usage: Extract MapConverter.zip into your server root directory. In server.cfg add MapConverter to plugins and MapConverter to filterscripts too! Afterwards move your maps to scriptfiles\maps\MTA which you want to convert. Start the server. Converter will convert every .map files from MTA directory to scriptfiles\maps\SAMP directory. Natives: Code:
native MC_LoadMap(const mapname[], callPawnFunctions); native MC_LoadAllMap(callPawnFunctions); native MC_UnloadMap(const mapname[]); native MC_SaveMap(mapid, E_SavingFlags:flags); native MC_GetMapName(mapid, name[], len = sizeof(name)); native MC_GetIDFromName(const mapname[]); native MC_IsValidMap(mapid); native MC_GetMapUpperID(); Saving options Code:
enum E_SavingFlags { ONLY_CREATE_VEHICLE = 1, // There will be no special data converted ex: paintjob, interior and mods. Only CreateVehicle() line CONVERT_NUMBER_PLATE = 2, // Convert vehicle number plate? HIDE_WHEN_ALPHA_NOT_255 = 4, // If you change the object alpha value different than 255, then hide object in samp? Its useful if you want to create invisible objects in samp CONVERT_ELEMENT_NAME = 8 // Convert the name of the element which you give to the element in MTA, useful if you want to find specific model after conversion }; Callbacks: Code:
forward OnMapLoadingStart(mapid, EMapType:maptype, callPawnFunctions); forward OnMapLoadingFinish(mapid, EMapType:maptype, callPawnFunctions, objects, removeobjects, vehicles, markers, pickups, actors); forward OnObjectDataLoaded(mapid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ, interior, virtualworld); forward OnObjectDataUnLoaded(mapid, extraid); forward OnRemoveObjectDataLoaded(mapid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius); forward OnRemoveObjectDataUnLoaded(mapid, extraid); forward OnVehicleDataLoaded(mapid, modelid, Float:fX, Float:fY, Float:fZ, Float:fAngle, color1, color2, paintjob, upgrades[], plate[], interior, virtualworld); forward OnVehicleDataUnLoaded(mapid, extraid); forward OnMarkerDataLoaded(mapid, E_MarkerType:type, Float:fX, Float:fY, Float:fZ, Float:fSize, interior, virtualworld); forward OnMarkerDataUnLoaded(mapid, extraid); forward OnPickupDataLoaded(mapid, modelid, Float:fX, Float:fY, Float:fZ, virtualworld); forward OnPickupDataUnLoaded(mapid, extraid); forward OnActorDataLoaded(mapid, modelid, Float:fX, Float:fY, Float:fZ, Float:fAngle, virtualworld); forward OnActorDataUnLoaded(mapid, extraid); Example output of a MTA map: Code:
#include <a_samp> #include <streamer> // Map Type: DM public OnPlayerConnect(playerid) { /*-------------------------------------------------- Remove Objects -------------------------------------------------*/ RemoveBuildingForPlayer(playerid, 1418, 2512.260254, -1683.393311, 13.234910, 3.923507); RemoveBuildingForPlayer(playerid, 1418, 2517.184814, -1684.861694, 13.543220, 3.923507); RemoveBuildingForPlayer(playerid, 1410, 2498.239990, -1688.230103, 13.295510, 4.462929); RemoveBuildingForPlayer(playerid, 1410, 2493.158691, -1687.941772, 13.388060, 4.462929); RemoveBuildingForPlayer(playerid, 1410, 2487.835693, -1687.999146, 13.150440, 4.462929); return 1; } public OnFilterScriptInit() { new tempvehid; /*-------------------------------------------------- Objects -------------------------------------------------*/ CreateDynamicObject(1225, 2496.800049, -1672.699951, 12.700000, 0.000000, 0.000000, 0.000000); // object (barrel4) (1) CreateDynamicObject(1225, 2495.100098, -1672.699951, 12.700000, 0.000000, 0.000000, 0.000000); // object (barrel4) (2) CreateDynamicObject(1225, 2495.199951, -1674.500000, 12.700000, 0.000000, 0.000000, 0.000000); // Test name CreateDynamicObject(1225, 2497.300049, -1674.500000, 12.700000, 0.000000, 0.000000, 0.000000); // object (barrel4) (4) CreateDynamicObject(1225, 2497.800049, -1676.400024, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel4) (5) CreateDynamicObject(1225, 2495.699951, -1676.400024, 12.700000, 0.000000, 0.000000, 0.000000); // object (barrel4) (6) CreateDynamicObject(1225, 2496.100098, -1678.199951, 12.700000, 0.000000, 0.000000, 0.000000); // object (barrel4) (7) CreateDynamicObject(1225, 2498.600098, -1678.500000, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel4) (8) CreateDynamicObject(1225, 2499.399902, -1680.800049, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel4) (9) CreateDynamicObject(1225, 2497.000000, -1680.699951, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel4) (10) CreateDynamicObject(1218, 2493.300049, -1672.800049, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel1) (1) CreateDynamicObject(1218, 2493.500000, -1674.300049, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel1) (2) CreateDynamicObject(1218, 2493.800049, -1675.900024, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel1) (3) CreateDynamicObject(1218, 2493.899902, -1677.599976, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel1) (4) CreateDynamicObject(1218, 2494.899902, -1680.400024, 12.800000, 0.000000, 0.000000, 0.000000); // object (barrel1) (5) /*-------------------------------------------------- Vehicles -------------------------------------------------*/ tempvehid = CreateVehicle(534, 2485.199951, -1679.500000, 13.200000, 0.000000, 86, 1, -1); // vehicle (Remington) (1) ChangeVehiclePaintjob(tempvehid, 2); AddVehicleComponentInline(tempvehid, 1087, 1010, 1126, 1185, 1178, 1080, 1122); tempvehid = CreateVehicle(560, 2480.899902, -1679.099976, 13.100000, 0.000000, 79, 29, -1); // vehicle (Sultan) (1) AddVehicleComponentInline(tempvehid, 1033, 1138, 1028, 1079, 1010, 1087, 1030, 1169, 1141); /*-------------------------------------------------- Checkpoints -------------------------------------------------*/ CreateDynamicRaceCP(2, 2481.8999, -1661.1000, 13.3000, 0.0, 0.0, 0.0, 1.0000); // SAMP CP 1 CreateDynamicRaceCP(2, 2482.3000, -1655.5000, 13.3000, 0.0, 0.0, 0.0, 1.0000); // marker (cylinder) (1) CreateDynamicCP(2477.2000, -1661.5000, 12.2645, 1.0000); // SAMP RaceCP CreateDynamicRaceCP(4, 2483.5000, -1658.2000, 17.3000, 0.0, 0.0, 0.0, 1.0000); // marker (ring) (1) CreateDynamicRaceCP(4, 2480.0000, -1658.4000, 15.1000, 0.0, 0.0, 0.0, 1.0000); // marker (ring) (2) CreateDynamicRaceCP(2, 2488.8000, -1656.9000, 13.4000, 0.0, 0.0, 0.0, 1.0000); // This corona has the maximum possible name lengt, do you see it? a SetDynamicObjectMaterial(CreateDynamicObject(19180, 2488.000000, -1665.900024, 14.800000, 0.0, 0.0, 0.0), 0, 0, "a", "a", 0xFD2900FF); // marker (arrow) (1) /*-------------------------------------------------- Pickups -------------------------------------------------*/ CreateDynamicPickup(1240, 2, 2476.600098, -1684.300049, 13.400000); // pickup (health) (1) CreateDynamicPickup(356, 2, 2474.399902, -1683.400024, 13.400000); // pickup (M4) (1) CreateDynamicPickup(348, 2, 2471.899902, -1681.900024, 13.400000); // pickup (Deagle) (1) CreateDynamicPickup(1240, 2, 2482.800049, -1679.500000, 13.300000); // pickup (health) (4) CreateDynamicPickup(1242, 2, 2470.199951, -1679.900024, 13.500000); // pickup (armor) (1) CreateDynamicPickup(342, 2, 2468.699951, -1678.400024, 13.500000); // pickup (Grenade) (1) CreateDynamicPickup(362, 2, 2467.800049, -1677.199951, 13.500000); // pickup (Minigun) (1) /*-------------------------------------------------- Actors -------------------------------------------------*/ CreateActor(169, 2478.800049, -1685.900024, 13.500000, 0.003000); // I would fuck her ass CreateActor(219, 2480.699951, -1686.099976, 13.500000, 30.000000); // ped (2) CreateActor(217, 2477.000000, -1686.099976, 13.500000, 180.000000); // Staff member guy CreateActor(145, 2485.000000, -1688.900024, 15.700000, 180.000000); // Drug bitch return 1; } stock AddVehicleComponentInline(vehicleid, ...) { for (new i = 0, j = numargs(); i != j; ++i) AddVehicleComponent(vehicleid, getarg(i)); } Download: https://github.com/kurta999/MapConverter Last edited by kurta999; 15/02/2017 at 07:20 PM. |
![]() |
![]() |
![]() |
#2 |
Godfather
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2012
Posts: 5,352
Reputation: 1195
|
![]()
OnConvertationStart should be OnConversionStart spelling error
![]() |
![]() |
![]() |
![]() |
#3 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,423
Reputation: 626
|
![]() |
![]() |
![]() |
![]() |
#4 |
High-roller
Join Date: Mar 2012
Location: /home
Posts: 3,253
Reputation: 378
|
![]()
Nice work, rep+=4.
no comments, very good ![]() |
![]() |
![]() |
![]() |
#5 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jun 2010
Posts: 2,454
Reputation: 569
|
![]()
Awesome work. I was just going to develop something like that for personal use, but you made it already. Good!
|
![]() |
![]() |
![]() |
#6 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2010
Location: Somewhere i belong
Posts: 1,425
Reputation: 138
|
![]()
Very great plugin. loved callbacks implemented and the plans for future !
|
![]() |
![]() |
![]() |
#7 |
Godfather
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2012
Location: Portugal
Posts: 7,146
Reputation: 774
|
![]()
Nice work man.
|
![]() |
![]() |
![]() |
#8 |
Huge Clucker
![]() ![]() ![]() Join Date: Nov 2013
Location: Dead Sea , Jordan
Posts: 241
Reputation: 26
|
![]()
Nice.
|
![]() |
![]() |
![]() |
#9 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Apr 2009
Location: Slovakia (HU)
Posts: 1,423
Reputation: 626
|
![]()
Thanks.
Would be good if someone would send me one MTA map which uses Roller Coaster Generator (RCG) resource. I need this to add support for convert rcg resource. |
![]() |
![]() |
![]() |
#10 |
Big Clucker
![]() ![]() Join Date: Jun 2014
Posts: 122
Reputation: 18
|
![]()
Did everything like you said here and when I reloadfs converter 'Sa-MP dedicated server stopped working', it crashes
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Include] rMTA - Easy MTA-Race Map Converter (Scriptside) | Narushi | Includes | 8 | 23/12/2014 09:27 PM |
[RYDER RACE] Race problem : Cant make new Race !!! | S_ILYa™ | Server Support | 6 | 25/10/2014 01:51 PM |
[Map] [Tuned Cars!][Drift!][Race!][Roleplay!] Aero's Underground Race League II! | Aerotactics | Maps | 12 | 03/04/2014 12:23 PM |
[Race]How to get Player Position in Race (example: 3rd/10) | Basss | Help Archive | 5 | 17/07/2009 09:23 PM |
[Tool/Web/Other] [TOOL] Offline Map, Car and Object Converter (MTA:Race->SA-MP) | Shargrat | Tools and Files | 2 | 12/05/2009 03:26 PM |