Best aproach to get the number of players at each hour
#4

You could do something such as:

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;
}
I assume this time calculation is correct and will work, although I haven't tested it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)