AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Map History (Updated 24-11-2013 @ 1.1.1) (https://forums.alliedmods.net/showthread.php?t=187141)

RedSword 06-09-2012 11:27

[Any] Map History (Updated 24-11-2013 @ 1.1.1)
 
3 Attachment(s)
Map History

v. 1.1.1

Features :
Why I made this plugin :
  • I felt like it was needed on my community's server, where an admin can't see map history because that server uses MAP and is very slowly getting on Sourcemod.
  • Admins sometimes want to vote a certain map, but they don't know when it was last played (I know, it is built-in in Sourcemod in "nextmap" plugin; but read the other points; and this one is standalone).
  • Let normal players know what were the last maps, so you can tell them to use !lastmaps. This prevents further whinning about asking for a map that was just played.

In short : plugin is standalone and everyone can see map history.

Commands :
  • <sm_lastmap | say !lastmap> to show what was the last map and when it started.
  • <sm_lastmaps | say !lastmaps> to show what were the last maps and when they started.

ConVars :
Code:

// Allow people to use 'lastmap' command to see the last map. 0=disable command, 1=enable command (default).
// -
// Default: "1.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
mh_allow_lastmap "1.0"

// Allow people to use the menu to show last maps. 0=disable command, 1=enable command (default).
// -
// Default: "1.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
mh_allow_menu "1.0"

// Minimum time in seconds between two menu requests for a player. Default 2.
// -
// Default: "2.0"
// Minimum: "0.000000"
mh_allow_menu_delaymin "2.0"

// Allow people to use the menu to show last maps. 0=disable command, 1=enable command (default).
// -
// Default: "32.00"
// Minimum: "0.000000"
// Maximum: "32.000000"
mh_allow_menu_mapnumbershown "32.00"

// Restrict 'lastmap' to people with this flag. "" for everyone.
// -
// Default: ""
mh_lastmap_flag ""

// Restrict 'lastmap' to people with this override. "" for everyone.
// -
// Default: ""
mh_lastmap_override ""

// Restrict 'menu' to people with this flag. "" for everyone.
// -
// Default: ""
mh_menu_flag ""

// Restrict 'menu' to people with this override. "" for everyone.
// -
// Default: ""
mh_menu_override ""

// Show current map in '!lastmaps' ? 1=yes, 0=no (default) ; changing value requires map change
// -
// Default: "0.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
mh_showcurrentmap "0.0"

Known bugs :
  • None at the moment, please report any.

Notes :
  • Place phrases in translation folder.
  • You may want to redefine the number of maps kept in memory at line 16 and recompile. 32 by default.
  • This uses a Panel and not a menu that you cycle through. This means a 1-page-only menu. I suggest avoiding big number of maps kept in history.
  • Thanks to graczu for his Mapcycle plugin that showed how to use Panels.

--------------

Changelog :
  • 1.0.0 Initial release. (09-06-2012)
  • 1.1.0 (20-12-2012)
    • Added support for admin flag and override. See ConVars :
      • mh_lastmap_flag
      • mh_lastmap_override
      • mh_menu_flag
      • mh_menu_override
    • Plugin now creates its own config files (due to a lot of ConVar) with the other SM cfgs (/cfg/sourcemod/).
    • Added possibility to choose the number of maps dynamically we want via a ConVar. See mh_allow_menu_mapnumbershown.
    • Added anti-menu spam. See ConVar mh_allow_menu_delaymin.
    • Removed FCVAR_NOTIFY from non-version ConVars and removed FCVAR_REPLICATED from version ConVar.
  • 1.1.1 (24-11-2013)
    • Modified how the plugin works (+updated for approval) :
      • It now uses the internal Sourcemod map history,
      • This allows to show the load the plugin on the fly and access the map history.
    • New convar mh_showcurrentmap, allowing to show or not the current map when using sm_lastmaps. Default is 0 (not showing current map).
    • Menu is now loaded on map change, rather than when asked (tiny optimization)
  • Approved by Peace-Maker. (31-12-2014)

Todo list :
  • None at the moment.

pillepallus 06-09-2012 15:04

Re: [Any] Map History
 
many thanks!!!! now i know how long i have to wait if map is recently played!!!! many many thanks!!!

and it would be creat when mapchooser extended would implement a feature to read this out and after crash or restart some recently played maps are still blocked.

RedSword 06-09-2012 15:56

Re: [Any] Map History
 
Quote:

Originally Posted by pillepallus (Post 1725658)
many thanks!!!! now i know how long i have to wait if map is recently played!!!! many many thanks!!!

and it would be creat when mapchooser extended would implement a feature to read this out and after crash or restart some recently played maps are still blocked.

Your reply is appreciated.

About mapchooser extension, I really don't plan on adding that. Since you have the time when a map started, you can calculate yourself how long the map was played for. In the image shown in the first post I quickly switched map a bunch of time to demonstrate my plugin at work; but those aren't realistic time intervals lol :$.

pillepallus 06-09-2012 17:30

Re: [Any] Map History
 
for guys like me is this plugin really great!!!! many thanks again!!!

i just want to play some maps and so i can caluclate how long i need to wait. so i can join later anddon't need to camp in spec. u saved so much of my time!!!!! my home server where i'm playing is using map rotation of 15 now so this is soooooo important to have.

ye integration in mapchooser isn't possible on ur side except u can write the data to disk or database (map and times). so mapchooser can grep the data. just an idea. i'm using mapchooser extended cause very good support and features. till now i saw only 1 other guy who requested this function. but i think its very useful to continue the map rotation depending recently played maps.

timort 07-24-2012 06:04

Re: [Any] Map History
 
Yep very nice ;)

shavit 07-24-2012 17:24

Re: [Any] Map History
 
How the heck the menu is blue? o.0

minimoney1 07-24-2012 17:45

Re: [Any] Map History
 
Quote:

Originally Posted by shavit (Post 1757481)
How the heck the menu is blue? o.0

Custom GUI?

RedSword 07-24-2012 20:40

Re: [Any] Map History
 
There is no menu. Only a non-menu panel.

thetwistedpanda 07-24-2012 20:45

Re: [Any] Map History
 
He's referring to your attached screenshot with blue font.

RedSword 07-24-2012 21:14

Re: [Any] Map History
 
Quote:

Originally Posted by thetwistedpanda (Post 1757605)
He's referring to your attached screenshot with blue font.

I thought that was normal. Well, yes a custom GUI apparently.

I did think it was the usual Panel behaviour (since a normal menu for me looks like this : http://forums.alliedmods.net/attachm...8&d=1313881034 )

Thanks for correcting me.


All times are GMT -4. The time now is 19:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.