I've tried to modify the mapchooser.sma to make a bit better for my server. I modified for date and number of players, but the plugin won't working. When the vote time comes the maps it's extracted from maps_mini.ini, "doesen't cares" about the number of players, and what time is it. I've tested it without "check the number of players", only "check the time", and it's working. I don't know what to do.
PHP Code:
static players[32], playerCount;
new maps_ini_file[64];
new hour, minute, second;
time(hour, minute, second);
get_players(players, playerCount, "ch");
get_configsdir(maps_ini_file, 63);
if (playerCount <= get_pcvar_num(pcvar_min_players)){
format(maps_ini_file, 63, "%s/maps/maps_mini.ini", maps_ini_file);
if (!file_exists(maps_ini_file))
get_cvar_string("mapcyclefile", maps_ini_file, 63)
if (loadSettings(maps_ini_file))
set_task(15.0, "voteNextmap", 987456, "", 0, "b")
}
else{
if (hour >= get_pcvar_num(pcvar_start_night) &&
hour < get_pcvar_num(pcvar_end_night)){
format(maps_ini_file, 63, "%s/maps/maps_night.ini", maps_ini_file);
if (!file_exists(maps_ini_file))
get_cvar_string("mapcyclefile", maps_ini_file, 63)
if (loadSettings(maps_ini_file))
set_task(15.0, "voteNextmap", 987456, "", 0, "b")
}
else{
format(maps_ini_file, 63, "%s/maps/maps_normal.ini", maps_ini_file);
if (!file_exists(maps_ini_file))
get_cvar_string("mapcyclefile", maps_ini_file, 63)
if (loadSettings(maps_ini_file))
set_task(15.0, "voteNextmap", 987456, "", 0, "b")
}
}