KillTimer with SetTimerEx
#1

What I need it a timer and after every 5 minutes on the server, the player gets 5 points.

I tried

new pointer[MAX_PLAYERS];

pointer[playerid] = SetTimerEx(...);

then OnPlayerDiconnect KillTimer(pointer[playerid]);

But it started to spam the 5 point timer when I relogged a few times, so it wasn't killing it.

If there a way to kill SetTimerEx?
Reply
#2

I thought KillTimer also works for SetTimerEx...

But, you can also try something like this:

pawn Код:
new bool:pointing[MAX_PLAYERS];
new Points[MAX_PLAYERS];

SetTimer("UpdatePoints", 30000, 1);

public UpdatePoints()
{
  for (new i=0; i<GetMaxPlayers(); i++)
  {
    if (pointing[i]) Points[i]++;
  }
}
Set "pointing[playerid]" true if you want players to get 5 ponits every 5 minutes
Reply
#3

Quote:
Originally Posted by Mikep
What I need it a timer and after every 5 minutes on the server, the player gets 5 points.

I tried

new pointer[MAX_PLAYERS];

pointer[playerid] = SetTimerEx(...);

then OnPlayerDiconnect KillTimer(pointer[playerid]);

But it started to spam the 5 point timer when I relogged a few times, so it wasn't killing it.

If there a way to kill SetTimerEx?
Ex works with kill for me at least... I just tested it this morning
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)