i just follow his tutorial, almost the same timer.
pawn Код:
//at the top of scripter
new Text:STime,
Tsec,
Thrs,
//OnGameModeInit
STime = TextDrawCreate(545.000000,19.000000,"07:10");
TextDrawAlignment(STime, 0);
TextDrawBackgroundColor(STime, 0x000000ff);
TextDrawFont(STime, 1);
TextDrawLetterSize(STime, 0.599999,1.800000);
TextDrawColor(STime, 0xffffffff);
TextDrawSetProportional(STime, 1);
TextDrawSetShadow(STime, 1);
Tsec= 10;
Thrs= 7;
SetTimer("GameClock", 1000, true);
//EveryWhere
forward GameClock();
public GameClock()
{
new string[7];
Tsec+=1;
if(Tsec==60) {
Tsec=00;
Thrs+=1;
}
if(Thrs==24) {
Tsec=00;
Thrs=0;
}
if(Tsec<10) {
format(string,sizeof(string),"%d:%d0",Thrs,Tsec);
}
if(Tsec>10) {
format(string,sizeof(string),"%d:%02d",Thrs,Tsec);
}
if(Thrs<10) {
format(string,sizeof(string),"0%d:%02d",Thrs,Tsec);
}
for(new i; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
SetPlayerTime(i,Thrs,Tsec);
}
}
TextDrawSetString(STime,string);
SetWorldTime(Thrs);
return 1;
}
//OnPlayerConnect
TextDrawShowForPlayer(playerid, STime);
I had the same problem when i made a clock... The basic timer just fails.