[HELP] About Timers.
#4

Quote:
Originally Posted by Angel φ
public Timer()
{
for(new x; x < 200; x++)
{
if(IsPlayerConnected(x))
{
// Your Code ; Don't use RETURN !
}
}
return 1;
}
thats so useless

and

Quote:
Originally Posted by Finn
pawn Код:
new timer;
pawn Код:
public OnGameModeInit()
{
  timer = SetTimer("Timer", 120000, false);
}
pawn Код:
zcmd(timer, playerid, params[])
{
  KillTimer(timer); // Kill the timer.
  timer = SetTimer("Timer", 120000, false); // Start the timer again.
  return 1;
}
pawn Код:
forward Timer();
pawn Код:
public Timer()
{
  Something();
  Happens();
  Here();
  After();
  2Min();
  return 1;
}
NOTE: This won't work with multiple players, you need to find out how to do it yourself.
he got it almost but i don't think cepiokas got zcmd

so change that part

pawn Код:
zcmd(timer, playerid, params[])
{
  KillTimer(timer); // Kill the timer.
  timer = SetTimer("Timer", 120000, false); // Start the timer again.
  return 1;
}
to

pawn Код:
OnPlayerCommandText(playerid,commandtext[])
{
  if (strcmp(cmdtext, "/timer", true) == 0)
    {
      KillTimer(timer); // Kill the timer.
      timer = SetTimer("Timer", 120000, false); // Start the timer again.
    }
  return 1;
}
Reply


Messages In This Thread
[HELP] About Timers. - by cepiokas - 07.10.2009, 14:39
Re: [HELP] About Timers. - by Finn - 07.10.2009, 15:11
Re: [HELP] About Timers. - by UsaBoy91 - 07.10.2009, 16:31
Re: [HELP] About Timers. - by saiberfun - 07.10.2009, 16:58
Re: [HELP] About Timers. - by cepiokas - 07.10.2009, 17:06

Forum Jump:


Users browsing this thread: 1 Guest(s)