Question
#1

Killing a Timer using SetTimerEx?
Reply
#2

forward timer(number);
new lmao;
...
lmao=SetTimerEx("timer",1000,1,"d",10);
...
KillTimer(lmao);
Reply
#3

Set a variable on the timer. A example is;

pawn Код:
new HelloWorld, times[MAX_PLAYERS];
public OnPlayerSpawn(playerid) {
  times[playerid] = 0;
  HelloWorld = SetTimerEx("HelloWorldTimer", 1000, 1, "d", playerid);
  return 1;
}

forward HelloWorldTimer(playerid);
public HelloWorldTimer(playerid) {
  switch(times[playerid]) {
    case 0: {
       print("Hello World");
       times[playerid] ++;
    }
    case 1: {
       print("Bye world");
       KillTimer(HelloWorld);
    }
  }
  return 1;
}
Reply
#4

yeah but for like if the person dies/disconnects it stops
Reply
#5

Place the KillTimer(Variable) in OnPlayerDeath or OnPlayerDisconnect.
Reply
#6

like this?

Код:
KillTimer(UsingWeed[playerid]);
Reply
#7

Quote:
Originally Posted by Kurence
forward timer(number);
new lmao;
...
lmao=SetTimerEx("timer",1000,1,"d",10);
...
KillTimer(lmao);
Lmao xD
Reply
#8

that isnt for a player
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)