03.04.2013, 10:26
(
Последний раз редактировалось PaddyCorleone; 04.04.2013 в 08:09.
Причина: Update
)
Paddy's Map Loader 0.2
Description:
This include allows you to load MTA .map files and create the objects/ vehicles without a converting site.
It's also able to load already converted SAMP objects/ vehicles from a .pml file (the files need to be ANSI encoded!).
I know that there are lots of these loaders out there but i was bored and try to make my own.
I tried to keep the usage as easy as possible but also provide some nice features.
Installation:
Simply copy/ download the include and save it in <Your Server Folder Here>\pawno\include...
(if you use a differend editor/ IDE I assume you know where to save the includes)
And include it somewhere under #include <a_samp> in your script.
Usage:
There are 8 main functions in this include:
There are some other functions too (a split function for example)...
Loading a MTA .map:
Drag the MTA .map file into your "scriptfiles" folder.
Next go to your script and decide where you want to load the Map.
Then simply load the map with this function:
The first parameter is the location of the file, the second is the drawing distance (it uses SA:MP's inbuild object streamer).
If you want to load the objects/ vehicles to an array use LoadMTAMapToArrays.
Sadly it doesn't support the MTA colors, so you need to apply SA:MP colors to all vehicles.
Loading a SA:MP .pml:
First you need to make a new file with a text editor of your choise (it must support ANSI encoding tough).
Next put all your SA:MP objects/ vehicles in there.
Example:
Save it as as .pml file in your scriptfiles folder.
Next go to your script and decide where you want to load the Map.
Then simply load the map with this function:
The first parameter is the location of the file, the second is the drawing distance (it uses SA:MP's inbuild object streamer).
If you want to load the objects/ vehicles to an array use LoadSAMPMapToArrays.
Removing maps/ Respawn vehicles:
This is very easy, just use the code below.
Just replace the <MAPFILE> with the name of you map (example: MAP.map).
If you only want to delete the objects/ vehicles use:
You can also respawn all the vehicles from the map file, just use:
Bugs/ Problems & Requests:
If you found a bug, have a problem just pm me/ reply to this thread.
If you want another map format added pm me with some example code pls.
Changelog:
Version 0.2:
[ADD] Added LoadMTAMapToArrays/ LoadSAMPMapToArrays so you can load maps to arrays in you Gamemode (usefull for gates and stuff...)
[ADD] Added a define for vehicle respawn-rate for LoadMTAMap/ LoadMTAMapToArrays
[FIX] You can now spawn vehicles at any time with LoadMTAMap/ LoadMTAMapToArrays
Download:
Old Versions: Here
This was only tested with SA:MP 0.3e!
Description:
This include allows you to load MTA .map files and create the objects/ vehicles without a converting site.
It's also able to load already converted SAMP objects/ vehicles from a .pml file (the files need to be ANSI encoded!).
I know that there are lots of these loaders out there but i was bored and try to make my own.
I tried to keep the usage as easy as possible but also provide some nice features.
Installation:
Simply copy/ download the include and save it in <Your Server Folder Here>\pawno\include...
(if you use a differend editor/ IDE I assume you know where to save the includes)
And include it somewhere under #include <a_samp> in your script.
Usage:
There are 8 main functions in this include:
Код:
LoadMTAMap(src[], Float:dist = 90.0) LoadSAMPMap(src[], Float:dist = 90.0) LoadMTAMapToArrays(src[], objar[], vehar[], Float:dist = 90.0); LoadSAMPMapToArrays(src[], objar[], vehar[], Float:dist = 90.0); RemoveMapObjects(map[]) RemoveMapVehicles(map[]) RespawnMapVehicles(map[]) RemoveMap(map[])
Loading a MTA .map:
Drag the MTA .map file into your "scriptfiles" folder.
Next go to your script and decide where you want to load the Map.
Then simply load the map with this function:
Код:
LoadMTAMap("<MAPNAME>.map", 123);
If you want to load the objects/ vehicles to an array use LoadMTAMapToArrays.
Sadly it doesn't support the MTA colors, so you need to apply SA:MP colors to all vehicles.
Код:
<vehicle ... color="<color1>,<color2>" ...</vehicle>
First you need to make a new file with a text editor of your choise (it must support ANSI encoding tough).
Next put all your SA:MP objects/ vehicles in there.
Example:
Код:
CreateObject(968,2238.1999512,2450.5000000,10.6000004,0.0000000,270.0000000,270.0000000); //object(barrierturn) (1) AddStaticVehicleEx(523,2314.0000000,2495.1999512,2.9000001,90.0000000,-1,-1,-1); //HPV1000
Next go to your script and decide where you want to load the Map.
Then simply load the map with this function:
Код:
LoadSAMPMap("<MAPNAME>.pml", 123);
If you want to load the objects/ vehicles to an array use LoadSAMPMapToArrays.
Removing maps/ Respawn vehicles:
This is very easy, just use the code below.
Код:
RemoveMap("<MAPFILE>");
If you only want to delete the objects/ vehicles use:
Код:
RemoveMapObjects("<MAPFILE>"); //or RemoveMapVehicles("<MAPFILE>");
Код:
RespawnMapVehicles("<MAPFILE>");
If you found a bug, have a problem just pm me/ reply to this thread.
If you want another map format added pm me with some example code pls.
Changelog:
Version 0.2:
[ADD] Added LoadMTAMapToArrays/ LoadSAMPMapToArrays so you can load maps to arrays in you Gamemode (usefull for gates and stuff...)
[ADD] Added a define for vehicle respawn-rate for LoadMTAMap/ LoadMTAMapToArrays
[FIX] You can now spawn vehicles at any time with LoadMTAMap/ LoadMTAMapToArrays
Download:
Old Versions: Here
This was only tested with SA:MP 0.3e!