how to make killtimer
#1

i need to make kill timer
onfilterscriptinit i got this
SetTimer("GiveScore", 60000, true);

then if someone types /afk there is this
KillTimer(GiveScore); // i get error error 076: syntax error in the expression, or invalid function call

then if someone types /afk again there is
SetTimer("GiveScore", 60000, true);

and public is

forward GiveScre;
public GiveScore()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
SetPlayerScore(i, GetPlayerScore(i) + 1);
}
}
}
Reply
#2

You need to name the timer.

example

pawn Код:
new timer;

timer = SetTimer(...

KillTimer(timer);

//other example with your script

new ScoreTimer;

ScoreTimer = SetTimer("GiveScore", 60000, true);

KillTimer(ScoreTimer);

forward GiveScore;
public GiveScore()
{
   for(new i=0; i < MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
      {
            SetPlayerScore(i, GetPlayerScore(i) + 1);
      }
   }
}
Also when you post something that is related with pawn use the above tags [pawn] [/ pawn] so we can see clearly your pawn code.
Reply
#3

thanks i try

thanks it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)