[Duda] Timers
#2

[Tutorial] Como Cronometrar.

pawn Код:
new Max;
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/comando", true))
  {
    if(GetTickCount() < Max)
    {
      new string[128];

      format(string, sizeof(string), "Todavнa no puedes usar este comando. Tienes que esperar %d segundos mбs!", floatround(floatdiv(Max - GetTickCount(), 1000)));
      SendClientMessage(playerid, COLOR, string);
    }
    Max = GetTickCount() + 3000; // 3000 es el tiempo en milisegundos, en este caso serнan tres segundos
    // todo lo del comando
    return 1;
  }
  return 0;
}
Reply


Messages In This Thread
[Duda] Timers - by Daniel_Barrera - 23.05.2010, 19:36
Re: [Duda] Timers - by Miguel - 23.05.2010, 19:48
Re: [Duda] Timers - by Daniel_Barrera - 23.05.2010, 21:55
Re: [Duda] Timers - by Daniel_Barrera - 23.05.2010, 22:19

Forum Jump:


Users browsing this thread: 1 Guest(s)