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

Less than 10 players - change the map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BackStats
Senior Member
Join Date: Oct 2008
Old 08-12-2010 , 16:42   Less than 10 players - change the map
Reply With Quote #1

While 10 active players (five on each team) everything is ok.
When the server is less than 10 players. Ex: 9, 8,7... the plugin launches a count of 5 minutes and after that time if the number of players not complete the server changes map automatically.

The maps can be changed will be set in mapcycle, and if possible the plugin have a cvar to switch on and off.
BackStats is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 08-12-2010 , 18:37   Re: Less than 10 players - change the map
Reply With Quote #2

i need this too help
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-12-2010 , 21:22   Re: Less than 10 players - change the map
Reply With Quote #3

look for GALILEO
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-13-2010 , 06:43   Re: Less than 10 players - change the map
Reply With Quote #4

Something like this maybe

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define MIN_PLAYERS 10
#define TASKID 225522

new g_mapcyclefile
new g_running

public plugin_init()
{
    
g_mapcyclefile get_cvar_pointer("mapcyclefile")
    
g_running register_cvar("minplayer_enable","1")
}
    
public 
client_disconnect()
{
    if(!
get_pcvar_num(g_running)) return PLUGIN_HANDLED

    
new sz_cyclefile[32]
    
get_pcvar_string(g_mapcyclefilesz_cyclefile31)
    static 
Players[32
    static 
playerCount
    get_players
(PlayersplayerCount)
    
    if(
playerCount MIN_PLAYERS && equal(sz_cyclefile"mapcycle_normal.txt"))
    {
        
set_task(300.0,"smallmaps",TASKID)
    }
}

public 
client_putinserver()
{
    if(!
get_pcvar_num(g_running)) return PLUGIN_HANDLED

    
new sz_cyclefile[32]
    
get_pcvar_string(g_mapcyclefilesz_cyclefile31)
    static 
Players[32
    static 
playerCount
    get_players
(PlayersplayerCount)
    
    if(
playerCount MIN_PLAYERS && equal(sz_cyclefile"mapcycle_normal.txt"))
    {
        
remove_task(TASKID)
    }
}

public 
smallmaps()
{
    new 
sz_cyclefile[32]
    
get_pcvar_string(g_mapcyclefilesz_cyclefile31)
    static 
Players[32
    static 
playerCount
    get_players
(PlayersplayerCount)
    
    if(
playerCount MIN_PLAYERS && equal(sz_cyclefile"mapcycle_normal.txt"))
    {
        
client_print(0print_center"Minimum number of players was not achieved, the map will be changed")
        
server_cmd("mapcyclefile mapcycle_small.txt")
        
server_cmd("mp_timelimit 1")
        
server_exec()
    }

__________________


Last edited by Jack86; 09-07-2010 at 03:57. Reason: updated
Jack86 is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 08-13-2010 , 13:00   Re: Less than 10 players - change the map
Reply With Quote #5

I can not test it now.
But he stops to count the time when 5x5 players? 5x4 and when it starts the countdown to change the map?
turn could put a cvar on/off?
BackStats is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-13-2010 , 18:23   Re: Less than 10 players - change the map
Reply With Quote #6

@Jack, mp_timelimit 0 means the current map will never end.
__________________
fysiks is offline
Jack86
Veteran Member
Join Date: Dec 2008
Location: Belgrade, Serbia
Old 08-13-2010 , 21:12   Re: Less than 10 players - change the map
Reply With Quote #7

Yea, ur right, i meant to put mp_timelimit 1 to force mapchange, and thats the easiest way 'cause i was to lazy to add SVC_INTERMISSION part
__________________

Jack86 is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 08-14-2010 , 09:42   Re: Less than 10 players - change the map
Reply With Quote #8

I must create a file with that name? mapcycle_small.txt
BackStats is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-14-2010 , 18:42   Re: Less than 10 players - change the map
Reply With Quote #9

Quote:
Originally Posted by BackStats View Post
I must create a file with that name? mapcycle_small.txt
You need to create two map files (according to the code as is) or only one if you replace mapcycle_normal.txt with mapcycle.txt in the code.
__________________
fysiks is offline
alexinno
Senior Member
Join Date: Mar 2007
Location: C:\
Old 09-06-2010 , 10:27   Re: Less than 10 players - change the map
Reply With Quote #10

thx for this plugin , testing it now... but a quick notice

Code:
set_task(300.0,"small_maps",TASKID)
should be
Code:
 set_task(300.0,"smallmaps",TASKID)
or change the function name to small_maps
__________________

[IMG]http://img188.**************/img188/5787/banner2rcw.png[/IMG]
alexinno 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 13:30.


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