23.05.2010, 19:48
[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;
}