#include <cstrike>
#pragma newdecls required
ConVar gConVarTimeStart, gConVarTimeEnd;
//https://forums.alliedmods.net/showthread.php?t=303346 by gubka | rework Drumanid
public void OnPluginStart()
{
gConVarTimeStart = CreateConVar("timemap_start", "01:00", "start times map de_dust2");
gConVarTimeEnd = CreateConVar("timemap_end", "08:00", "end times map de_dust2");
AutoExecConfig(true, "timemap");
}
public void OnMapEnd()
{
char sTime[512];
FormatTime(sTime, sizeof(sTime), "%H", GetTime());
int H = StringToInt(sTime);
char sBegin[3][8];
GetConVarString(gConVarTimeStart, sTime, sizeof(sTime));
ExplodeString(sTime, ":", sBegin, sizeof(sBegin), sizeof(sBegin[]));
char sEnd[3][8];
GetConVarString(gConVarTimeEnd, sTime, sizeof(sTime));
ExplodeString(sTime, ":", sEnd, sizeof(sEnd), sizeof(sEnd[]));
if(StringToInt(sBegin[0]) <= H && StringToInt(sEnd[0]) > H) ServerCommand("changelevel de_dust2");
}