clock
#1

clock is going so fast like this > 2:00 and then 2:20 > 2:40 > 3:00 > 3:20 > 3:40 >4:00 like this

here is script.

PHP код:
#include <a_samp>
forward RealHourUpdate();
new 
T_MIN=0T_HOUR=23T_DAY=0;
new 
WorldTime;
new 
Text:DAN;
new 
Text:Clock;
public 
OnPlayerSpawn(playerid)
{
TextDrawShowForAll(DAN);
TextDrawShowForAll(Clock);
return 
1;
}
public 
OnGameModeInit()
{
SetTimer("SetRandomWeather"420000true);
SetTimer("RealHourUpdate"1000true);
DAN TextDrawCreate(497.0000005.000000"/");
TextDrawFont(DAN3);
TextDrawLetterSize(DAN0.61.5);
TextDrawSetOutline(DAN2);
TextDrawSetProportional(DAN1);
TextDrawSetShadow(DAN1);
Clock TextDrawCreate(546.921.0"/");
TextDrawSetShadow(Clock1);
TextDrawSetOutline(Clock2);
TextDrawLetterSize(Clock0.62.4);
TextDrawFont(Clock3);
TextDrawSetProportional(Clock1);
return 
1;
}
public 
RealHourUpdate()
{
new 
hmsc;
gettime(hmsc);
if(
WorldTime != h)
{
WorldTime h;
SetWorldTime(T_HOUR);
}
T_MIN++;
if(
T_MIN == 60)
{
T_MIN=0;
T_HOUR++;
}
if(
T_HOUR == 24)
{
T_HOUR=0;
T_DAY++;
}
if(
T_DAY == 7)
{
T_DAY=0;
}
if(
T_DAY == 0)
{
TextDrawSetString(DAN,"Monday");
new 
string[]="Monday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 1)
{
TextDrawSetString(DAN,"Tuesday");
new 
string[]="Tuesday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 2)
{
TextDrawSetString(DAN,"Wednesday");
new 
string[]="Wednesday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 3)
{
TextDrawSetString(DAN,"Thursday");
new 
string[]="Thursday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 4)
{
TextDrawSetString(DAN,"Friday");
new 
string[]="Friday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 5)
{
TextDrawSetString(DAN,"Saturday");
new 
string[]="Saturday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
if(
T_DAY == 6)
{
TextDrawSetString(DAN,"Sunday");
new 
string[]="Sunday";
new 
result[156];
format(resultsizeof(result), "worldtime %s %02d:%02d",stringT_HOURT_MIN);
SendRconCommand(result);
}
new 
string[256];
if(
T_MIN 10)
    {
        if(
T_HOUR 10)
        {
            
format(string,sizeof(string),"0%d:0%d",T_HOUR,T_MIN);
            
TextDrawSetString(Clock,string);
        }
        else
        {
            
format(string,sizeof(string),"%d:0%d",T_HOUR,T_MIN);
            
TextDrawSetString(Clock,string);
        }
        }
        else
        {
        if(
T_HOUR 10)
        {
            
format(string,sizeof(string),"0%d:%d",T_HOUR,T_MIN);
            
TextDrawSetString(Clock,string);
        }
        else
        {
            
format(string,sizeof(string),"%d:%d",T_HOUR,T_MIN);
            
TextDrawSetString(Clock,string);
        }
        }
        
/*new str[256];
format(str, 256, "worldtime %02d:%02d", T_HOUR, T_MIN);
SendRconCommand(str);*/
for(new g=0;g<200;g++)
{
}

Reply


Messages In This Thread
clock - by sscarface - 07.02.2013, 17:37
Re: clock - by Scenario - 07.02.2013, 17:41
Re: clock - by sscarface - 07.02.2013, 19:39
Re: clock - by Misiur - 07.02.2013, 20:07
Re: clock - by sscarface - 07.02.2013, 20:17
Re: clock - by Misiur - 07.02.2013, 20:28
Re: clock - by sscarface - 07.02.2013, 20:34
Re: clock - by Misiur - 07.02.2013, 21:05
Re: clock - by sscarface - 07.02.2013, 21:19

Forum Jump:


Users browsing this thread: 8 Guest(s)