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.