#include <amxmodx>
#include <reapi>
#define RESET_TIME_NIGHT "23:30:00"
#define RESET_TIME_DAY "06:00:00"
public plugin_init()
{
// Here it is worth checking for the current time if, if it is night time, then set m_GameDesc, "Night VIP" when changing cards
//
//if(Time == Night)
//{
// set_member_game(m_GameDesc, "Ночной вип");
//}
//if(Time == Day)
//{
// set_member_game (m_GameDesc, "Normal day");
//}
set_task_runtime(RESET_TIME_NIGHT, "CalledMight", 5687567907);
set_task_runtime(RESET_TIME_DAY, "CalledDay", 65857686758);
}
public CalledMight()
{
set_member_game(m_GameDesc, "Ночной вип");
}
public CalledDay()
{
set_member_game (m_GameDesc, "Normal Day");
}
stock set_task_runtime(time[11], const func[], id = 0, const param[]="", len = 0)
{
new h[5], m[5], s[5]
get_time("%H", h, charsmax(h))
get_time("%M", m, charsmax(m))
get_time("%S", s, charsmax(s))
new iCurSeconds = (str_to_num(h) * 3600) + (str_to_num(m) * 60) + str_to_num(s)
replace_all(time, charsmax(time), ":" , " ")
parse(time, h, charsmax(h), m, charsmax(m), s, charsmax(s))
new iRunSeconds = (str_to_num(h) * 3600)+ (str_to_num(m) * 60) + str_to_num(s)
new iTotal = RunSeconds - CurSeconds
if(iTotal<=0)
Total = CurSeconds - RunSeconds
return set_task(float(iTotal), func, id, param, len)
}