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();
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
};
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);
#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));
}
OnConvertationStart should be OnConversionStart spelling error
|
Does somebody would interested in better version of this plugin?
I have rewritten it before some weeks ago, just for learning some new techniques in C++. Now it works both at windows & linux. It converts everything from MTA, even peds to actors. After the conversion has done, it creates a complete compilable .pwn file which you can load into server or copy conent of .pwn file and paste it into your object script. Its possible to call a pawn callback during the conversion with converted object parameters, this is useful when you want to test the map in game to make sure that you like it or not. ofc, it is very fast. |
Does this load the files and create everything? OR does it just output a pwn file?
Both possible. |
Crayder: have you tried to load ipl into samp, if yes it was succesdfully? Ive tried before but idk how i should convert these quats, there are something changed because "normal" quat algorithms doesnt works.
Mi idea was before to use limit adjustert and load all server obj as ipl. Benefits would be: smoother obj loading, lod support, badwich saving I can do everything except convert these f.... Quats to euler angles and vice versa |