15.12.2009, 04:22
I've got something like this:
What I want to do is every 10 minutes something happens, so I tried this:
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!
pawn Код:
SetTimer("OneSecondTimer", 1000, true);
pawn Код:
public OneSecondTimer(playerid)
{
Server[Seconds]++;
if(Server[Seconds] == 60)
{
Server[Minutes]++;
}
bla...
bla...
bla...
return 1;
}
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;
}
(I decided to use this in order to not use too many timers).
Thanks!