How to make this condition?
#1

I've got something like this:
pawn Код:
SetTimer("OneSecondTimer", 1000, true);
pawn Код:
public OneSecondTimer(playerid)
{
  Server[Seconds]++;
  if(Server[Seconds] == 60)
  {
    Server[Minutes]++;
  }
  bla...
  bla...
  bla...
  return 1;
}
What I want to do is every 10 minutes something happens, so I tried this:
pawn Код:
public OneSecondTimer(playerid)
{
  Server[Seconds]++;
  if(Server[Seconds] == 60)
  {
    Server[Minutes]++;
  }
  bla...
  bla...
  bla...
  else if(Server[Minutes] == 0 || Server[Minutes] == 10 || Server[Minutes] == 20 || Server[Minutes] == 30 || Server[Minutes] == 40 || Server[Minutes] == 50)
  {
    // do something
  }
  return 1;
}
But by doing that, "do something" would be repeated 60 times in a minute, and I want it to be done just once every 10 minutes. How can I do it?
(I decided to use this in order to not use too many timers).

Thanks!
Reply


Messages In This Thread
How to make this condition? - by M1GU3L - 15.12.2009, 04:22
Re: How to make this condition? - by Babul - 15.12.2009, 05:35
Re: How to make this condition? - by [HiC]TheKiller - 15.12.2009, 08:12
Re: How to make this condition? - by M1GU3L - 15.12.2009, 15:27
Re: How to make this condition? - by Babul - 25.12.2009, 16:09

Forum Jump:


Users browsing this thread: 3 Guest(s)