Function
#1

I need a function for online time.

60 seconds = 1min
60mins = 1 hour

same as real. anyone help me?
Reply
#2

PHP код:
forward SyncTime();
public 
SyncTime()
{
    new 
string[64];
    new 
tmphour;
    new 
tmpminute;
    new 
tmpsecond;
    
gettime(tmphourtmpminutetmpsecond);
    
FixHour(tmphour);
    
tmphour shifthour;
    if ((
tmphour ghour) || (tmphour == && ghour == 23))


in OngamemodeInit

use this line


PHP код:
    if(!realtime)
    {
        
SetWorldTime(wtime);
        
gTime wtime;
    }

    if (
realtime)
    {
        new 
tmphour;
        new 
tmpminute;
        new 
tmpsecond;
        
gettime(tmphourtmpminutetmpsecond);
        
FixHour(tmphour);
        
tmphour shifthour;
        
SetWorldTime(tmphour);
        
gTime tmphour;
    }

    if(!
realtime)
    {
        
SetWorldTime(wtime);
        
gTime wtime;
    } 
in
task SyncUp
put this line

PHP код:
SyncTime(); 
This is only for RP server
Reply
#3

Quote:
Originally Posted by SoFahim
Посмотреть сообщение
PHP код:
forward SyncTime();
public 
SyncTime()
{
    new 
string[64];
    new 
tmphour;
    new 
tmpminute;
    new 
tmpsecond;
    
gettime(tmphourtmpminutetmpsecond);
    
FixHour(tmphour);
    
tmphour shifthour;
    if ((
tmphour ghour) || (tmphour == && ghour == 23))

in OngamemodeInit

use this line


PHP код:
    if(!realtime)
    {
        
SetWorldTime(wtime);
        
gTime wtime;
    }
    if (
realtime)
    {
        new 
tmphour;
        new 
tmpminute;
        new 
tmpsecond;
        
gettime(tmphourtmpminutetmpsecond);
        
FixHour(tmphour);
        
tmphour shifthour;
        
SetWorldTime(tmphour);
        
gTime tmphour;
    }
    if(!
realtime)
    {
        
SetWorldTime(wtime);
        
gTime wtime;
    } 
in
task SyncUp
put this line

PHP код:
SyncTime(); 
This is only for RP server
where's fixhour(blabla)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)