Score..
#5

Quote:
Originally Posted by Hiddos
pawn Код:
new ScoreTimer;
forward ScoreUpdate();

public OnGameModeInit()
{
  ScoreTimer = SetTimer("ScoreUpdate",600000,1);
  return 1;
}

public OnGameModeExit()
{
  KillTimer(ScoreTimer);
  return 1;
}

public ScoreUpdate()
{
  for(new i; i < MAX_PLAYERS; i++)
  {
     if(IsPlayerConnected(i))
     {
       SetPlayerScore(i,GetPlayerScore(i)+1);
     }
  }
  return 1;
}
No need to kill the timer when the gamemode unloads, it can't call the timer is the gamemode isn't loaded.
Reply


Messages In This Thread
Score.. - by TheNotorius - 06.04.2010, 10:40
Re: Score.. - by Hiddos - 06.04.2010, 11:16
Re: Score.. - by [MWR]Blood - 06.04.2010, 11:49
Re: Score.. - by TheNotorius - 06.04.2010, 14:08
Re: Score.. - by Mikep. - 06.04.2010, 14:15

Forum Jump:


Users browsing this thread: 3 Guest(s)