[INC] MTA .map loader UPDATED 12 Dec 2010 (0.3c objects support) -
mick88 - 13.09.2010
MTA .map loader
by mick88
This is an easy to use include that allows you to load objects directly from .map file without need to convert. The script can load not only objects but also vehicles. Pickups and checkpoints are not currently supported. The vehicles will load with all applied modifications (rims, nitrous, hydraulics, spoilers etc) and paintjobs.
SSCANF2 plugin by ****** is required to use this filterscript!
available here:
https://sampforum.blast.hk/showthread.php?tid=120356[/CENTER]
Changes in version 0.2:- Added support for SA-MP 0.3c objects
- Added storing object/vehicle IDs
- Added function to unload single map
- This script is now an include
- Added support for custom vehicle numberplates (SA-MP 0.3c only)
- Added function to unload all current map files
- Added function checking if map is loaded
- Support for Incognito's streamer
Functions:
Код:
LoadMtaMap(file[], convert03c=false)
IsMapLoaded(file[])
UnloadMtaMap(file[])
UnloadAll()
Usage:
* Place
mtamap.inc in pawno/include folder
* Put
#include mtamap on top of your gamemode script
* place all your .map files in the scriptfiles folder
* Use
LoadMtaMap("filename.map") anywhere in your script to load map.
* compile and run your script, the objects will be loaded from file. You can unload filterscript after map is loaded
example:
Код:
public OnGameModeInit()
{
LoadMtaMap("LosSantos.map");
LoadMtaMap("LasVenturas.map");
LoadMtaMap("Island.map");
LoadMtaMap("03ctest.map", true);
}
Support for Incognito's streamer
All you have to do is include
streamer.inc before
mtamap.inc nad put streamer in server.cfg. Script will detect it automatically and start using it. Default streaming distance is 300.0, you can change it in #define.
SA-MP 0.3c Support added
New version adds support for 0.3c objects and numberplaters. To convert object ids from MTA to 0.3c simply add
true as second parameter in
LoadMtaMap():
Код:
LoadMtaMap("03ctest.map", true);
The numberplates will load automatically. Script will work on either 0.3b or 0.3c without any changes.
MTA editor VS sa-mp server:
![](http://screenshot.xfire.com/s/104118243-2.jpg)
Re: MTA .map loader -
Shockey - 13.09.2010
Awesome gonna test this
Re: MTA .map loader -
Retardedwolf - 13.09.2010
http://pastebin.com/WGjzs4Mw
Mirrored.
This would be good if this supported access to other folders except scriptfiles.
Maybe another command to convert it too?
Re: MTA .map loader -
Dime - 13.09.2010
looks fine
gona test it after i sleep few hours lol
and question:
if we ig load objects/vehicles
will objects/vehicles stay there if server restarts?
Re: MTA .map loader -
mick88 - 13.09.2010
Quote:
Originally Posted by oттo
and question:
if we ig load objects/vehicles
will objects/vehicles stay there if server restarts?
|
it's hard to tell, i didn't test it; if you gmx maybe the vehicles stay since they are created by FS not the GM, but if you shutdown the server and start it, everything will need to be loaded up again.
Quote:
Originally Posted by Retardedwolf
This would be good if this supported access to other folders except scriptfiles.
Maybe another command to convert it too?
|
samp doesn't support access to other folders afaik but you can try using '../../../maps/file.map' or simply get a plugin that allows it. The parameter you pass to the function is the file path so you can make it whatever you want like "maps/mymap.map" to access scriptfiles/maps/mymap.map file
Re: MTA .map loader -
CrunkBankS - 13.09.2010
Please add function UnLoadMtaMap
Re: MTA .map loader -
royal_king - 13.09.2010
nice its really good i like this
![Wink](images/smilies/wink.png)
keep it up make more useful programs like this
Re: MTA .map loader -
mick88 - 13.09.2010
Quote:
Originally Posted by CrunkBankS
Please add function UnLoadMtaMap ![Smiley](images/smilies/smile.png)
|
you need to destroy all items and then reload all other .map files that's the only way since the script doesn't keep track of spawned items. Maybe later I will work on the option to unload only objects from certain map.
Re: MTA .map loader -
Rokzlive - 13.09.2010
Thanks mick, i can always rely on you
![Cheesy](images/smilies/biggrin.png)
-Whatcha
Re: MTA .map loader -
mick88 - 13.09.2010
Quote:
Originally Posted by Jay_
Nice idea. It would be nice however if this didn't require the sscanf plugin. As I understand, the PAWN version of sscanf supports delimiters in a similar sense so therefore I don't think it would be too hard to edit.
|
Yes but as far as I remember pawn sscanf crashes with long floats. Floats in mta map files have way more digits after comma than pawno ones. But I should try, maybe modify sscanf that would indeed be way better, I just didn't consider that since I've been using sscanf2 for a while now.
Re: MTA .map loader -
boyan96 - 23.09.2010
C:\Documents and Settings\User\Desktop\Bulgarian Server 0.2.2\gamemodes\ecmn1.pwn(12
![Cool](images/smilies/cool.gif)
: fatal error 100: cannot read from file: "mtamap"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
please help
Re: MTA .map loader -
mick88 - 23.09.2010
Quote:
Originally Posted by boyan96
C:\Documents and Settings\User\Desktop\Bulgarian Server 0.2.2\gamemodes\ecmn1.pwn(12 ![Cool](images/smilies/cool.gif) : fatal error 100: cannot read from file: "mtamap"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
please help
|
You need to copy the inc file to yout current pawno include directory.
Re: MTA .map loader -
Jumpman23 - 24.09.2010
nice script
how safe is it to be loading and deleting maps with this if the server has around 20 players or more?
Re: MTA .map loader -
mick88 - 24.09.2010
Quote:
Originally Posted by Jumpman23
nice script
how safe is it to be loading and deleting maps with this if the server has around 20 players or more?
|
I don't see any problem unless you mapped some islands or bridges then you shouldn't reload them when players are on top of them. My server has 52 player slots and I have to reload maps from time to time and there is no problems at all.
Re: MTA .map loader -
HyperZ - 24.09.2010
Awesome ......
Re: MTA .map loader -
boyan96 - 24.09.2010
mick88 thanks you very much sorry for my bad english
Re: MTA .map loader -
multinfs - 09.11.2010
is this only for mta? cuz it wont work for me...
Re: MTA .map loader -
Haydz - 09.11.2010
Quote:
Originally Posted by multinfs
is this only for mta? cuz it wont work for me...
|
It's for samp thats why it's on SA-MP forums..
Re: MTA .map loader -
The_Moddler - 25.11.2010
This doesn't work with Incognitos plugin..
I do:
pawn Код:
#define ADD_OBJECT(%1) CreateDynamicObject(%1)
But it won't load the objects..
EDIT:
Pffffff... nevermind, I wasn't loading the plugin ^_^
Re: MTA .map loader -
mick88 - 12.12.2010
Major update in the script. It is now an include and supports SA-MP 0.3c