[Filterscript] - MapLoader finished

(600 downloads | 973 views)

MapLoader Description


Maploader is a small and very basic filterscript, that allows you to use multiple maps in a session (without restarting the server to change the maps).

It allows you to add unlimited maps, and set your own switch time.

When a switch is initiated, the old map is removed, and a random map (fase) is loaded.

The idea was that it would be usefull on small servers with CoD/BF like maps and minigames.

The script has only one command, for RCON admins. /changenow, which will force the map change.

I know it's basic, so if you have any suggestions, tell me, and I will try to put that into the next update.

Version 1.0b and 1.1 do NOT come with any mapping, I might add maps in the future if people want that.

The Maploader is an idea from zClaw, credits to him for the idea!

/changenow - this will initiate the map switch process (with a 10 second player warn delay).

After you've compiled the maploader.pwn, place the .amx file in your filterscripts folder, and add 'maploader' to your filterscripts line in your server.cfg .

Maploader will read from and write to a file located in your scriptfiles directory, so make sure your scriptfiles folder writable!

In the source, you will find some comments which explain how to add new mapping or change the switchtime.

[5/7/13] - Updated topic with new layout and documentation
[5/7/13] - Version 1.1 released
Optimized code
New map loading system
Timers fixed

[15/02/2013] - Version 1.0b released

This is my first public release, so maybe some of you think it sucks, that's ok, please tell me that, and tell me what I can do better in the future!


Adding new mappings is easier than you might think! First, open up the mapping.inc, go to the fase you want the mapping to be in, and paste it there. Now, save the include, and recompile the script. Easy as that! If you have any problems with adding maps, post a reply and ask for help, I'll do my best to help you.

The following things are there for you to configure to your needs.

The change interval:

#define CHANGE_INTERVAL 15*60000

The change interval holds the value of the switch timer. Change the number before the *60000 to the time in minutes you want between the switch times.

The max fases:

#define MAX_FASES 3

The MAX_FASES define holds the number of fases the script has. Everytime you add a fase, increase this number.

I can understand if 3 fases are not enough for you. To add fases, do the following.

  1. Increase the MAX_FASES define at the top of the script with the amount of fases you add.

  2. Go to the Changemap(fase); public, and add a case.

  3. Inside the case, add 'Mapping_CreateFase'. Replace with the name of the number, like Four, Five or Six.

  4. Go to the mapping.inc, add a forward for the new fase public.

  5. In the mapping.inc, also add the public Mapping_CreateFase.

  6. Inside the callback in the mapping.inc, add the mapping for the new fase.

  7. Done!

If you have any problems when adding fases, post a reply, and we'll solve it.