SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 13/09/2010, 11:08 AM   #1
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 170
Reputation: 32
Lightbulb [INC] MTA .map loader UPDATED 12 Dec 2010 (0.3c objects support)

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.

Pastebin download: http://pastebin.com/xa7AJ6Nv

SSCANF2 plugin by ****** is required to use this filterscript!
available here: http://forum.sa-mp.com/showthread.php?t=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:
Code:
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:
Code:
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():
Code:
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:

Last edited by mick88; 12/12/2010 at 11:01 PM. Reason: Update
mick88 is offline   Reply With Quote
Old 13/09/2010, 11:11 AM   #2
Shockey
Big Clucker
 
Join Date: Jul 2010
Posts: 108
Reputation: 0
Default Re: MTA .map loader

Awesome gonna test this
Shockey is offline   Reply With Quote
Old 13/09/2010, 11:22 AM   #3
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,468
Reputation: 60
Default Re: MTA .map loader

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?
Retardedwolf is offline   Reply With Quote
Old 13/09/2010, 11:22 AM   #4
Dime
Huge Clucker
 
Join Date: Jul 2010
Posts: 257
Reputation: 1
Default Re: MTA .map loader

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?
Dime is offline   Reply With Quote
Old 13/09/2010, 11:33 AM   #5
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 170
Reputation: 32
Default Re: MTA .map loader

Quote:
Originally Posted by oттo View Post
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 View Post
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
mick88 is offline   Reply With Quote
Old 13/09/2010, 11:39 AM   #6
CrunkBankS
Huge Clucker
 
CrunkBankS's Avatar
 
Join Date: Feb 2009
Location: Novorossiysk
Posts: 471
Reputation: 9
Default Re: MTA .map loader

Please add function UnLoadMtaMap
__________________

Music Producer

CrunkBankS is offline   Reply With Quote
Old 13/09/2010, 11:57 AM   #7
royal_king
Gangsta
 
royal_king's Avatar
 
Join Date: Jul 2010
Location: Hyderabad, India (i think)
Posts: 598
Reputation: 38
Default Re: MTA .map loader

nice its really good i like this keep it up make more useful programs like this
royal_king is offline   Reply With Quote
Old 13/09/2010, 12:18 PM   #8
mick88
Big Clucker
 
mick88's Avatar
 
Join Date: Jan 2010
Location: Ireland
Posts: 170
Reputation: 32
Default Re: MTA .map loader

Quote:
Originally Posted by CrunkBankS View Post
Please add function UnLoadMtaMap
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.
mick88 is offline   Reply With Quote
Old 13/09/2010, 06:23 PM   #9
Rokzlive
Gangsta
 
Rokzlive's Avatar
 
Join Date: Aug 2010
Location: Winder, GA USA
Posts: 577
Reputation: 12
Default Re: MTA .map loader

Thanks mick, i can always rely on you -Whatcha
Rokzlive is offline   Reply With Quote
Old 13/09/2010, 10:19 PM   #10
Jay_
Gangsta
 
Jay_'s Avatar
 
Join Date: Jul 2009
Posts: 652
Reputation: 197
Default Re: MTA .map loader

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.
Jay_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] [REL] XML loader Zeex Plugin Development 52 04/06/2017 09:53 AM
[Plugin] [REL] Hash File Loader VRocker Plugin Development 24 11/12/2009 12:59 PM
Yrace Auto loader addysnow1 Help Archive 0 17/11/2009 02:20 PM
[Include] [INC] Filterscript Loader Ignas1337 Includes 21 29/06/2009 07:58 PM
[ INCLUDE ] FS & GM ( Un & Re ) Loader illay Filterscripts 5 27/06/2009 06:04 PM


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.