Yes is there in plugin_init(). Really I don't get it... why the plugin works with "end night & start night" and the "check the number of players" it's not working. Sorry for my expression, I can't explain it better.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define SELECTMAPS 5
#define charsof(%1) (sizeof(%1)-1)
new Array:g_mapName;
new g_mapNums;
new g_nextName[SELECTMAPS]
new g_voteCount[SELECTMAPS + 2]
new g_mapVoteNum
new g_teamScore[2]
new g_lastMap[32]
new g_coloredMenus
new bool:g_selected = false
new pcvar_end_night;
new pcvar_start_night;
new pcvar_min_players;
public plugin_init()
{
register_plugin("Nextmap Chooser", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("mapchooser.txt")
register_dictionary("common.txt")
g_mapName=ArrayCreate(32);
new MenuName[64]
format(MenuName, 63, "%L", "en", "CHOOSE_NEXTM")
register_menucmd(register_menuid(MenuName), (-1^(-1<<(SELECTMAPS+2))), "countVote")
register_cvar("amx_extendmap_max", "90")
register_cvar("amx_extendmap_step", "15")
pcvar_start_night = register_cvar("start_night", "0")
pcvar_end_night = register_cvar("end_night", "11")
pcvar_min_players = register_cvar("min_players", "6")
if (cstrike_running())
register_event("TeamScore", "team_score", "a")
get_localinfo("lastMap", g_lastMap, 31)
set_localinfo("lastMap", "")
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")
}
}
g_coloredMenus = colored_menus()
}