[HELP] About Timers.
#1

Hey. Look, guys. I want to make like that. I have simple timer, everything OKAY. But i want to make that if i type /timer , that timer refresh and it start count again. But if i didn't type /timer, after 2minutes something happened?

Thanks for response.
Reply
#2

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.
Reply
#3

public Timer()
{
for(new x; x < 200; x++)
{
if(IsPlayerConnected(x))
{
// Your Code ; Don't use RETURN !
}
}
return 1;
}
Reply
#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
#5

Thanks alot. You all so help me to make a new RP. Respect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)