Raised This Month: $105 Target: $400
 26% 

Map Size Picker


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 10-06-2006 , 12:09   Map Size Picker
Reply With Quote #1

Map Size Picker
AMX_MSP v1.6


This is my first "real" plugin, so any advice is really appreciated

Aren't You tired of playing 2vs2 on huge maps like de_dust2? You don't have access to amx_votemap nor amx_map. Even if You're an admin, You're forcing Your players to play on map, that isn't made for current player count.

Here is the solution - amx_msp

Whenever there are to many or not enough players for the map, the plugin shows the vote with 6 (#define MAX_VOTE_MAPS 6 <- change this) maps, picked according to the current player count. Before this happens, the HUD message is displayed with 60 seconds countdown. When player connects or disconnects, the countdown is cancelled IF the player count is right for current map.

amx_msp uses config file addons/amxmodx/msp.ini (You can change this path in source) - the structure is as follows:
map_name minimum_players maximum_players
i.e. cs_assault 8 20
You can copy Your mapcycle.txt or maps.ini file - amx_msp skips maps without minimum_players and maximum_players.

The plugin also displays vote just before the end of map (so You don't need any "mapchooser" and such).

If there is no msp config for current map, the HUD message is displayed. In such situation any admin, which have admin_map priviliges, can set max and min players using:
amx_msp min max

To fix: "no such command"
TODO: translation, code optimization, using mapcycle.txt

History:
v1.6
- amx_nextmap is dynamically updated depending on number of players.
- fixed some other problems
v1.5b
- if current number of players is higher than config says, the countdown starts at 60s/(current_player_count-max_players_for_map)
- if current number of players is lower than config says, the countdown starts at 180s/(min_players_for_map-current_player_count)
Attached Files
File Type: sma Get Plugin or Get Source (amx_msp.sma - 3760 views - 8.4 KB)

Last edited by KobraPL; 02-01-2007 at 10:43.
KobraPL is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-06-2006 , 12:12   Re: Map Size Picker
Reply With Quote #2

don't post link to ur sma plz use the attachment and it will make another link for the compiled version too
k007 is offline
Send a message via MSN to k007
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 10-06-2006 , 12:16   Re: Map Size Picker
Reply With Quote #3

Quote:
Originally Posted by k007 View Post
don't post link to ur sma plz use the attachment and it will make another link for the compiled version too
as I wrote before - I can't:

Warning: fopen() [function.fopen.php]: SAFE MODE Restriction in effect. The script whose uid is 2533 is not allowed to access /home/groups/alliedmodders/forums/files/2/1/4/0/2 owned by uid 33 in /includes/class_dm_attachment.php on line 574

Warning: fopen(./files/2/1/4/0/2/11244.attach) [function.fopen.php]: failed to open stream: No such file or directory in /includes/class_dm_attachment.php on line 574
KobraPL is offline
Old 10-06-2006, 14:11
n-o-l-o
This message has been deleted by n-o-l-o. Reason: Wrong.
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 10-06-2006 , 18:55   Re: Map Size Picker
Reply With Quote #4

should be something like this
Code:
new g_mspFile[] = "dir"
u don't use 32, ur using this var for a dir...

Last edited by k007; 10-06-2006 at 18:57.
k007 is offline
Send a message via MSN to k007
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 10-07-2006 , 10:09   Re: Map Size Picker
Reply With Quote #5

Thanks, edited the source.
KobraPL is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-07-2006 , 10:28   Re: Map Size Picker
Reply With Quote #6

Don't use hardcoded paths. Use get_configsdir() instead.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 10-07-2006 , 13:56   Re: Map Size Picker
Reply With Quote #7

Quote:
Originally Posted by MaximusBrood View Post
Don't use hardcoded paths. Use get_configsdir() instead.
Thank You, I read sticked topic - sorry for not obeying. Fixed!
KobraPL is offline
z0nax
Member
Join Date: Mar 2006
Location: Denmark | In my dark roo
Old 10-08-2006 , 16:01   Re: Map Size Picker
Reply With Quote #8

Wow nice!
I think this is usefull.
__________________
- ZoNaX^
http://forums.alliedmods.net/faq.php...b_board_search
Offering free help to install:
AMXx, Plugins, Adding Admins.
The most general things to know.
PM me.
z0nax is offline
Send a message via MSN to z0nax
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 10-09-2006 , 06:20   Re: Map Size Picker
Reply With Quote #9

I'm planning to make an option, which will speed-up the countdown if current player count exceeds MAX_FOR_MAP by X. I use High Ping Kicker on my server - if there are many players and the map is small, half of them will be kicked by HPK. The faster the countdown, the faster optimal map will be played.
KobraPL is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-15-2006 , 16:33   Re: Map Size Picker
Reply With Quote #10

The attachment manager is fixed. Please attach the plugin.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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

Forum Jump


All times are GMT -4. The time now is 04:14.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode