Timer problem / question
#1

I have following timer:

pawn Код:
forward Timer(playerid);
pawn Код:
SetTimer("Timer",1800000,false);
pawn Код:
public Timer(playerid)
{
    SendClientMessage(playerid, COLOR_YELLOW, "xD");
    GivePlayerMoney(playerid, 15000);
    KillTimer(Timer(playerid));
   
}
How to make it it comes only ONCE, when "xD" has appeared it doesn't repeat, Killtimer didn't take effect. Please help me
Reply
#2

Try this:

pawn Код:
forward Timer(playerid);
pawn Код:
new lol;
pawn Код:
lol = SetTimerEx("Timer", 1800000, 0, "i", playerid);
pawn Код:
public Timer(playerid)
{
  SendClientMessage(playerid, COLOR_YELLOW, "xD");
  GivePlayerMoney(playerid, 15000);
  KillTimer(lol);
  return 1;
}
Reply
#3

Quote:
Originally Posted by еddy
Try this:

pawn Код:
forward Timer(playerid);
pawn Код:
new lol;
pawn Код:
lol = SetTimerEx("Timer", 1800000, 0, "i", playerid);
pawn Код:
public Timer(playerid)
{
  SendClientMessage(playerid, COLOR_YELLOW, "xD");
  GivePlayerMoney(playerid, 15000);
  KillTimer(lol);
  return 1;
}
Actually that's not right. Timer's name is here: SetTimerEx(" -> ThisTimer", 1800000, 0, "i", playerid);. There cannot be made another variable :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)