Help with Clock System ! + 1 Rep !
#1

Hello, I have a problem
My real time is 18:00 and my samp server show with three hours behind
like 18:00 real time and on my samp server show 14:00 ...
Help me guys
PHP код:
stock CalculeazaTimp(secunde)
{
    new 
time secunde;
    new 
ora time/3600;
    
time time%3600;
    new 
minute time/60;
    
time time%60;
    new 
secunde2 time;
    new 
string[10];
    
format(string,sizeof(string),"%02d:%02d:%02d",ora,minute,secunde2);
    return 
string;
}
stock CalculeazaTimp2(secunde)
{
    new 
time secunde;
    
time time%3600;
    new 
minute time/60;
    
time time%60;
    new 
secunde2 time;
    new 
string[10];
    
format(string,sizeof(string),"%02d:%02d",minute,secunde2);
    return 
string;

Reply
#2

Why you make it so complicated?

Just do this:

Код:
new h,m,s,string[16];
gettime(h,m,s);
format(string,sizeof(string),"%02d:%02d:%02d",h,m,s); 
return string;
Reply
#3

i don't now how to make it...
Reply
#4

when i start servr from PC it's worked, but now i have host and dosen't work !...., it's fucked up.
Sorry for my bad english
Reply
#5

Where is the Code for the TextDraw?

What do you write inside it (TextDrawSetString...)
Reply
#6

This is the code TextDraw
PHP код:
Date TextDrawCreate(542.0000618.960021,"--");
    
TextDrawFont(Date,1);
    
TextDrawLetterSize(Date,0.3679991.525333);
    
TextDrawColor(Date,-16777279);
    
TextDrawSetShadow(Date1);
    
TextDrawSetOutline(Date1);

    
Time TextDrawCreate(553.20007322.400056,"--");
    
TextDrawFont(Time,3);
    
TextDrawLetterSize(Time,0.5079992.486044);
    
TextDrawColor(Time,-16777279);
    
TextDrawSetShadow(Time1);
    
TextDrawSetOutline(Time1); 
Reply
#7

No, where is the TextDrawSetString function for the Time TextDraw?
Reply
#8

PHP код:
public OtherTimer()
{
    new 
string[256];
    new 
stringg[256];
    new 
year,month,day,hours,minutes,seconds;
    
getdate(yearmonthday), gettime(hoursminutesseconds);
    
format(stringsizeof string"%d/%s%d/%s%d"day, ((month 10) ? ("0") : ("")), month, (year 10) ? ("0") : (""), year);
    
TextDrawSetString(Datestring);
    
format(stringsizeof string"%s%d:%s%d", (hours 10) ? ("0") : (""), hours, (minutes 10) ? ("0") : (""), minutes, (seconds 10) ? ("0") : (""), seconds);
    
TextDrawSetString(Timestring); 
Reply
#9

Write it like this:

Код:
new string[256],stringg[256];
new year,month,day,h,m,s;
getdate(year, month, day), gettime(h, m, s);
format(string, sizeof string, "%02d/%02d/%d", day, month, year);
TextDrawSetString(Date, string);
format(string, sizeof string, "%02d:%02d:%02d",h,m,s);
TextDrawSetString(Time, string);
And if it doesn't (but only then) work, do this:

Код:
format(string, sizeof string, "%02d:%02d:%02d",h+4,m,s);
Reply
#10

I set this
PHP код:
 format(stringsizeof string"%02d:%02d:%02d",h+3,m+5,s); 
and now work's , i wait to see if payday works ! THANK YOU !!!! :***** + REP
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)