03.02.2015, 04:05
Add this on top of the script:
OnGameModeInit
Add this anywhere on your script:
PHP код:
new Tsec;
new THrs;
PHP код:
Tsec= 0;
THrs= 12;
SetTimer("TimeU",60000,true);
PHP код:
forward TimeU();
public TimeU()
{
new string[7];
Tsec+=1;
if(Tsec==60)
{
Tsec=0;
THrs+=1;
}
if(THrs==24)
{
Tsec=0;
THrs=0;
}
if(THrs>9)
{
if(Tsec<10)
{
format(string,sizeof(string),"%d:0%d",THrs,Tsec);
}
if(Tsec>9)
{
format(string,sizeof(string),"%d:%d",THrs,Tsec);
}
}
if(THrs<10)
{
if(Tsec<10)
{
format(string,sizeof(string),"0%d:0%d",THrs,Tsec);
}
if(Tsec>9)
{
format(string,sizeof(string),"0%d:%d",THrs,Tsec);
}
}
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerTime(i,THrs,Tsec);
}
}
SetWorldTime(THrs);
TextDrawSetString(Textdraw3,string);
}