#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Online Helper"
#define VERSION "0.1"
#define AUTHOR "Idea by Nordic Warrior"
new const szTargetMap[] = "de_dust2_2x2"; // Карта по умолчанию
new cpTimelimit, g_iRestoreTimeLimit, bool:isTargetMap;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
if(!is_map_valid(szTargetMap))
{
pause("ad");
log_amx("The map name is not valid");
return;
}
register_logevent("Rlog_Round_Draw", 4, "1=Round_Draw");
register_logevent("Rlog_Game_Commencing", 2, "1=Game_Commencing");
cpTimelimit = get_cvar_pointer("mp_timelimit");
g_iRestoreTimeLimit = get_pcvar_num(cpTimelimit);
new mapname[MAX_NAME_LENGTH];
get_mapname(mapname, charsmax(mapname));
if(!strcmp(mapname, szTargetMap))
isTargetMap = true;
}
public Rlog_Game_Commencing()
{
if(isTargetMap)
set_pcvar_num(cpTimelimit, g_iRestoreTimeLimit);
}
public Rlog_Round_Draw()
{
if(get_playersnum_ex(GetPlayers_ExcludeHLTV))
return;
if(isTargetMap)
{
set_pcvar_num(cpTimelimit, 0);
return;
}
engine_changelevel(szTargetMap);
}