Raised This Month: $51 Target: $400
 12% 

Natural Selection Nextmap Replacement


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Natural Selection        Category:   Server Management        Approver:   SniperBeamer (61)
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-21-2004 , 17:53   Natural Selection Nextmap Replacement
Reply With Quote #1

This plugin replaces nextmap.amx, so that it follows the variables in Natural-Selection's mapcycle.
It updates itself each time someone says "nextmap", ensuring that the next map will be correct. It checks the number of players, and compares it to the minplayers and maxplayers directives in the mapcyclefile.
To use this, ensure that each map is only in the map cycle once, and that each map has a minplayers and maxplayers after it (if it does not have both, you may run into infinite loops/nextmap not being set correctly. If the map is in the file more then once, it will always thing that the map is the last one in mapcyclefile, meaning more errors about next map.

When you use this, disable nextmap.amx, or they will conflict

If you have more then 64 maps in your mapcycle, or a map with a name longer then 128 characters, you need to edit the #defines at the top of the plugin
Attached Files
File Type: sma Get Plugin or Get Source (ns_nextmap.sma - 3035 views - 4.4 KB)
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 06-21-2004 , 19:06  
Reply With Quote #2

Why can't you just make it compatible with 128 car's, and more then 64 maps?
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-21-2004 , 19:32  
Reply With Quote #3

There always is an upper limit, you have to change ONE line of code for each of them, its not a hard task even if you have ever seen small code before
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 06-21-2004 , 19:46  
Reply With Quote #4

Quote:
Originally Posted by devicenull
There always is an upper limit, you have to change ONE line of code for each of them, its not a hard task even if you have ever seen small code before
I see, now, did you make this plugin out of bordom?
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-21-2004 , 20:45  
Reply With Quote #5

Yes, I did, Have a problem with it?
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Girthesniper
Senior Member
Join Date: Mar 2004
Location: Maryland
Old 06-22-2004 , 12:57  
Reply With Quote #6

Quote:
Originally Posted by devicenull
Yes, I did, Have a problem with it?
No, just saying, its been done already. But its something good to do with your time. I gave it a 5.
__________________
BANNED
Girthesniper is offline
Send a message via AIM to Girthesniper Send a message via MSN to Girthesniper
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-22-2004 , 17:50  
Reply With Quote #7

Its been done for Amx, not Amxx.. and the Amx one didn't look at the minplayers/maxplayers directive
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Hypergrip
New Member
Join Date: Jun 2004
Old 06-24-2004 , 18:43  
Reply With Quote #8

When starting the server I get an error:
Code:
L 06/24/2004 - 22:48:17: [AMXX] Run time error 4 on line 104 (plugin "ns_nextmap.amx")
During the game nextmap does two things:
When triggered by amx (automatic call) it just says "Nextmap is:" withot anything behind it.
When triggered by a user saying "nextmap" it gives an error "map not in mapcycle. can't find position" or something like this.

Here is a list of all my modules
Code:
Currently loaded plugins:
      description      stat pend  file              vers      src  load  unlod
 [ 1] AMX Mod X        RUN   -    amxx_mm_i386.so   v0.16     ini  ANY   ANY  
 [ 2] Cheating-Death   RUN   -    cdmod_i686.so     v4.21.0   ini  Chlvl Chlvl
 [ 3] Unstuck Pro      RUN   -    unstuck_mm_i386.  v1.00a    ini  Pause Pause
 [ 4] mm_awards        RUN   -    mm_award_i386.so  v1.0      ini  ANY   ANY  
 [ 5] ENGINE           RUN   -    engine_amx_i386.  v0.16     cmd  ANY   ANY  
 [ 6] NS2AMX           RUN   -    amxx_ns2amx_i386  v1.0.0.4  cmd  ANY   ANY  
6 plugins, 6 running
and all the plugins I'm running
Code:
amxx plugins
Currently loaded plugins:
       name               version  author            file             status   
 [  1] Admin Base         0.16     AMXX Dev Team     admin.amx        running  
 [  2] Admin Commands     0.9      default           admincmd.amx     running  
 [  3] Admin Help         0.16     AMXX Dev Team     adminhelp.amx    running  
 [  4] Menus Front-End    0.16     AMXX Dev Team     menufront.amx    running  
 [  5] Commands Menu      0.16     AMXX Dev Team     cmdmenu.amx      running  
 [  6] Players Menu       0.16     AMXX Dev Team     plmenu.amx       running  
 [  7] Maps Menu          0.16     AMXX Dev Team     mapsmenu.amx     running  
 [  8] Anti Flood         0.16     AMXX Dev Team     antiflood.amx    running  
 [  9] Admin Chat         0.16     AMXX Dev Team     adminchat.amx    running  
 [ 10] Admin Votes        0.16     AMXX Dev Team     adminvote.amx    running  
 [ 11] Nextmap            0.1      devicenull        ns_nextmap.amx   running  
 [ 12] TimeLeft           0.16     AMXX Dev Team     timeleft.amx     running  
 [ 13] Nextmap Chooser    0.16     AMXX Dev Team     mapchooser.amx   running  
 [ 14] Scrolling Message  0.16     AMXX Dev Team     scrollmsg.amx    running  
 [ 15] Info. Messages     0.16     AMXX Dev Team     imessage.amx     running  
 [ 16] Welcome Message    0.16     AMXX Dev Team     welcomemsg.amx   running  
 [ 17] Pause Plugins      0.16     AMXX Dev Team     pausecfg.amx     running  
 [ 18] Display rules on   1.00     [TeamHoward]Papa  ServerRules.amx  running  
 [ 19] Unchain            1.7      mE @ psix.info    me_unchain.amx   running  
 [ 20] Locked Spectate    1.5      Cheesy Peteza     lockedspectate.  running  
 [ 21] Simple Slots       1.6.1    DynAstY           simpleslots.amx  running  
 [ 22] Exec               1.0      ToXiC             amx_exec.amx     running  
22 plugins, 22 running
I hope this info can help you find a bug (or tell me what i did wrong)

/Hyper
Hypergrip is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-24-2004 , 20:08  
Reply With Quote #9

Whats in the cvar "mapcyclefile".. and can you post the actual map cycle file? The map not found usually occurs when the server is switched to a map that isnt in the map cycle by an admin.. and I'm assuming it wasnt that case?
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Hypergrip
New Member
Join Date: Jun 2004
Old 06-25-2004 , 07:10  
Reply With Quote #10

mapcyclefile = "mapcycle.txt" (since i didn't change anything i think that's just fine).

Here's my mapcycle.txt (int he nsp directory)

Code:
tofu@debian:/tools/hlds_l_test/nsp$ cat mapcycle.txt 
// Old default instructions:
//
// Instructions for using mapcycle.txt
// No, you can't change maxplayers on the server, but you can skip maps that don't fit the current # of players
// If no suitable match is found anywhere in your mapcycle file, then the server just moves to the next map in the file anyway.
// Minplayers or maxplayers set to 0 mean don't restrict based on that parameter.  You don't have to include minplayers or maxplayers if you
//  are not making a restriction.  They default to 0 if missing.
// You can list a file twice in the rotation now
// You can issue a command ( rather than setting key value pairs ) at the server console by bracketing it with a blank
//  key value: e.g., \mycommand\\
// minplayers and maxplayers are special tokens and are parsed and removed before the commands are executed
// Commands are executed just after the changelevel command occurs.
// Be sure to remove conflicting settings from any server.cfg or listenserver.cfg files you use since those values will stomp
//  on the ones you set here
// The double quotes are necessary
// BTW, the old format will still work
//
// NS instructions:
//
// Other notes: 
// - Combat and NS maps are mixed to both types for variety.  
// - Use minplayers of 0 for popular combat maps, so an empty server is ready for small numbers of players to join.
// - Reduced maxplayers on bast and hera for CPU reasons
// 
ns_metal "\minplayers\16\maxplayers\32\"
ns_caged "\minplayers\16\maxplayers\32\"
co_angst "\minplayers\6\maxplayers\20\"
ns_hera "\minplayers\16\maxplayers\24\"
ns_lost "\minplayers\16\maxplayers\32\"
ns_nothing "\minplayers\16\maxplayers\32\"
co_faceoff "\minplayers\0\maxplayers\18\"
ns_mineshaft "\minplayers\16\maxplayers\32\"
co_daimos "\minplayers\8\maxplayers\20\"
ns_bast "\minplayers\14\maxplayers\28\"
ns_origin "\minplayers\16\maxplayers\32\"
co_kestrel "\minplayers\8\maxplayers\20\"
ns_tanith "\minplayers\16\maxplayers\32\"
co_rebirth "\minplayers\4\maxplayers\20\"
ns_nancy "\minplayers\14\maxplayers\32\"
ns_veil "\minplayers\16\maxplayers\32\"
co_core "\minplayers\0\maxplayers\20\"
co_ulysses "\minplayers\4\maxplayers\20\"
ns_eclipse "\minplayers\14\maxplayers\32\"
co_pulse "\minplayers\8\maxplayers\20\"
ns_ayumi "\minplayers\16\maxplayers\32\"
ns_agora "\minplayers\16\maxplayers\32\"
Hypergrip is offline
Reply



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 00:34.


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