Raised This Month: $ Target: $400
 0% 

New Mapcycle !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andy_viper
BANNED
Join Date: Apr 2010
Old 05-31-2010 , 11:52   New Mapcycle !
Reply With Quote #1

Hello,
I need a plugin modification!
I want that plugin change the map when on the server are 12 players or much change, to big maps and when are 12 players or less, change to little maps.
I want to set these maps in two ini files in the folder configs.
For little maps to set emptycycle.ini and for large maps dailycycle.ini .
Can do this for me?
I found a plugin that do that but i want to modify to read maps from ini files.
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Inteligent Map Change"
#define VERSION "0.1"
#define AUTHOR "SAMURAI"


new const g_maps[][] =
{
    "cs_discounter",
    "fy_snow",
    "fy_snow3",
    "fy_dust",
    "mini_dust2",
    "awp_india",
    "aim_map"
}

new pplayers;



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
    
    pplayers = register_cvar("imc_maxplayers","8");
}


public event_new_round()
{
    new players = get_playersnum(1);
    new tleft = get_timeleft();
    
    if(tleft <= 40 && players <= get_pcvar_num(pplayers) )
    {
        new mapname[32], str[32];
        get_mapname(mapname,31);
        
        formatex(str,31,"%s",g_maps[random(sizeof g_maps)]);
        
        if(!is_map_valid(str) )
            return PLUGIN_CONTINUE;
            
        
        if(equali(mapname,str) )
            return PLUGIN_CONTINUE;
        
        samurai_map("%s",str);
    }
    
    return PLUGIN_CONTINUE;
}
        

/* samurai_map 
ex: samurai_map("de_dust")      */
stock samurai_map(const mapname[], {Float,Sql,Result,_}:...)
{
    if(strlen(mapname) != 0) {
        server_cmd("changelevel %s",mapname);
    }
    
}
Sorry for my english....
Thanks.
andy_viper is offline
andy_viper
BANNED
Join Date: Apr 2010
Old 06-05-2010 , 08:04   Re: New Mapcycle !
Reply With Quote #2

UP!
Can you help me? (
andy_viper is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-05-2010 , 13:03   Re: New Mapcycle !
Reply With Quote #3

I really like the idea.
But in my opinion, change mapcycle (cvar) to a different mapcycle file instead than change map direcly to a smaller or bigger.
12+ or 12- players, this would be annoying. Use min_players 10 and max_players 14, something like that.
Otherwise it will mess up the server to make mapchanges when players leave/join between 11-13 players.
This is really great idea because 20+ players is not fun to play on a fy_* or aim_* map.
Rirre is offline
andy_viper
BANNED
Join Date: Apr 2010
Old 06-05-2010 , 16:17   Re: New Mapcycle !
Reply With Quote #4

Can someone improve this plugin :-s ?
andy_viper is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-05-2010 , 18:38   Re: New Mapcycle !
Reply With Quote #5

Improved ;)

PHP Code:
#include <amxmodx>

public client_putinserver()
{
    
UpdateCycleFile()
}

public 
client_disconnect()
{
    
UpdateCycleFile()
}

UpdateCycleFile()
{
    if( 
get_playersnum() > 12 )
    {
        
set_cvar_string("mapcyclefile""dailycycle.ini")
    }
    else
    {
        
set_cvar_string("mapcyclefile""emptycycle.ini")
    }

.ini files go in your mod's directory (for Counter-Strike it goes in /cstrike/)
__________________

Last edited by fysiks; 06-05-2010 at 18:43.
fysiks is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-06-2010 , 12:06   Re: New Mapcycle !
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Improved ;)

PHP Code:
#include <amxmodx>

public client_putinserver()
{
    
UpdateCycleFile()
}

public 
client_disconnect()
{
    
UpdateCycleFile()
}

UpdateCycleFile()
{
    if( 
get_playersnum() > 12 )
    {
        
set_cvar_string("mapcyclefile""dailycycle.ini")
    }
    else
    {
        
set_cvar_string("mapcyclefile""emptycycle.ini")
    }

.ini files go in your mod's directory (for Counter-Strike it goes in /cstrike/)
Ignore bots, HLTV/proxies & spectators please
Rirre is offline
andy_viper
BANNED
Join Date: Apr 2010
Old 06-06-2010 , 16:30   Re: New Mapcycle !
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Improved ;)

PHP Code:
#include <amxmodx>

public client_putinserver()
{
    
UpdateCycleFile()
}

public 
client_disconnect()
{
    
UpdateCycleFile()
}

UpdateCycleFile()
{
    if( 
get_playersnum() > 12 )
    {
        
set_cvar_string("mapcyclefile""dailycycle.ini")
    }
    else
    {
        
set_cvar_string("mapcyclefile""emptycycle.ini")
    }

.ini files go in your mod's directory (for Counter-Strike it goes in /cstrike/)
Thank you very much :X
This plugin isn't only for server side use, i will read the ini files and i show them on mpStats(see on my signature).
I will add you to credits thanx .

Last edited by andy_viper; 06-06-2010 at 16:34.
andy_viper is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-06-2010 , 16:46   Re: New Mapcycle !
Reply With Quote #8

Quote:
Originally Posted by andy_viper View Post
This plugin isn't only for server side use, i will read the ini files and i show them on mpStats(see on my signature).
That makes no sense. This plugin is ONLY server side.
__________________
fysiks is offline
andy_viper
BANNED
Join Date: Apr 2010
Old 06-06-2010 , 16:57   Re: New Mapcycle !
Reply With Quote #9

Before, with that plugin my script wasn't able to read the maps because theire were defined in the plugin...
Now the maps are in that ini files so now i can read the maps .
andy_viper 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 09:23.


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