05.06.2017, 13:15
You could do something such as:
I assume this time calculation is correct and will work, although I haven't tested it.
pawn Code:
new server_hour;
// ongamemodeinit
new minute, second;
gettime(server_hour, minute, second);
HourTimer = SetTimer("HourlyUpdate", (60 - minute) * 1000, true);
//
forward HourlyUpdate();
public HourlyUpdate()
{
new gPlayers, local_query[128];
for(new i; i <= GetPlayerPoolSize(); i++)
{
if(IsPlayerConnected(i)) gPlayers++;
}
mysql_format(gSQLConnection, local_query, sizeof local_query, "INSERT..."
mysql_pquery(gSQLConnection, local_query);
return true;
}