Raised This Month: $ Target: $400
 0% 

Maps on specific hours


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
daNzEt
Senior Member
Join Date: Sep 2010
Location: Romania
Old 12-28-2013 , 12:12   Re: Maps on specific hours
Reply With Quote #6

Try this:

PHP Code:
#include < amxmodx >

new const maxplayers 10

new const harti[][] =
{
    
"aim_map",
    
"cs_deagle5",
    
"cs_assault",
    
"cs_1337_assault",
    
"fy_buzzkill",
    
"fy_dinoiceworld",
    
"fy_dustbomb",
    
"fy_dust",
    
"fy_iceworld",
    
"fy_rush",
    
"fy_snow",
    
"fy_snow2010",
    
"fy_snow2011",
    
"fy_snow3",
    
"de_dust2x2"
}

public 
plugin_init( )
{
    
register_plugin"Map Scheduler" "1.0""daNzEt" );

    
register_logevent"EventRoundStart"2"1=Round_Start" );
}

public 
EventRoundStart( )
{
    
set_task60.0"checkplayers" );
}

public 
checkplayers( )
{    
    if ( 
get_playersnum( ) <= maxplayers 
    {
        new 
mapname[31]
        
get_mapname(mapname,31)
        
        if(
equali(mapname"aim_map") || equali(mapname"cs_deagle5") || equali(mapname"cs_assault") || equali(mapname"cs_1337_assault")
        || 
equali(mapname"fy_buzzkill") || equali(mapname"fy_dinoiceworld") || equali(mapname"fy_dustbomb") || equali(mapname"fy_dust")
        || 
equali(mapname"fy_iceworld") || equali(mapname"fy_rush") || equali(mapname"fy_snow") || equali(mapname"fy_snow2010")
        || 
equali(mapname"fy_snow2011") || equali(mapname"fy_snow3") || equali(mapname"de_dust2x2"))
        {
            return 
PLUGIN_HANDLED;
        }
    
        else
        {
            
client_print(0print_chat"Because of the small number of players we will change this map")
            
            
set_task30.0"changemap" );
        }
    }
        
    else if ( 
get_playersnum( ) > maxplayers 
    {
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;    
}

public 
changemap( )
{            
    
server_cmd"changelevel %s"harti[random_num(0charsmax(harti))] )

And modify which maps you want server to change and number of maxplayers.

Last edited by daNzEt; 12-29-2013 at 05:59.
daNzEt is offline
Send a message via Yahoo to daNzEt Send a message via Skype™ to daNzEt
 



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 20:27.


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