PHP Code:
stock set_task_runtime(str_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(str_time, charsmax(str_time), ":" , " ");
parse(str_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 = iRunSeconds - iCurSeconds;
if(iTotal <= 0)
{
iTotal = ( 86400 - iCurSeconds ) + iRunSeconds;
}
return set_task(float(iTotal), func, id, param, len);
}