01.04.2012, 07:46
pawn Код:
#include <a_samp>
#pragma tabsize 0
forward public SetCountDownTime(hour,min,sec);
forward UpdateTime();
new update;
//--------------------------------------------------
public SetCountDownTime(hour,min,sec)
{
printf("Time: %02d:%02d:%02d",hour,min,sec);
update = SetTimer("UpdateTime",1000,0);
sec --;
if(sec == 0) {
min --;
}
if(min == 0) {
hour --;
}
if(hour == 0 && min == 0 && sec == 0) {
printf("Time Over");
KillTimer(update);
return 1;
}
return 1;
}
public UpdateTime()
{
SetTimer("SetCountDownTime",0,0);
}
public OnGameModeInit()
{
SetCountDownTime(2,50,50); // Time Test - 2 Hour, 50 Min, 50 Sec
return 1;
}