Server Time Bug
#1

PHP код:
public Timer()
{
     new 
timestring[256];
      new 
daystring[256];
    new 
gseconds GM[gtime] % 60,
    
gminutes = (GM[gtime] - gseconds) / 60;
    
GM[gtime] ++;
    
format(timestringsizeof (timestring), "%02d:%02d"gminutesgseconds);
    
TextDrawSetString(GM[gtTD][1],timestring);
    
TextDrawShowForAll(GM[gtTD][1]);
    
format(daystringsizeof (daystring), "%s",GetDayName());
    
TextDrawSetString(GM[gtTD][0],daystring);
    
TextDrawShowForAll(GM[gtTD][0]);
    if(
GM[gday]==&& GM[gtime]==1440)
    {
        
GM[gday] = 0;
        
GM[gtime] = 0;
    }
    if(
GM[gtime]==120//2 mins
    
{
        
moneybag ;
    }
    if(
GM[gtime]==240)//4 mins
    
{
        new 
string[256];
        
format(stringsizeof(string), "* Today's jackpot has reached to $%s. Draw will be held at 06:00 ! Use /lotto to purchase a ticket.",FormatNumber(LottoJackpot));
        
SendClientMessageToAll(COLOR_LOTTO,string);
        
SendClientMessageToAll(COLOR_RED,"{66ff33}[Money Bag] A Money Bag has been reported lost Somewhere in Los Santos. Find it you will be rewarded.");
    }
    if(
GM[gtime]==360)//6 mins
    
{
        
LottoDraw();
         
SendClientMessageToAll(COLOR_LOTTO,"* Next Lotto Draw will be at 18:00. Type /lotto to purachase a Ticket.");
    }
    if(
GM[gtime]==480)//8 mins
    
{
        
ChangeStage(); //money bag system
    
}
    if(
GM[gtime]==720)//12 mins
    
{
        
ChangeStage(); //money bag system
    
}
    if(
GM[gtime]==960)//16 mins
    
{
        
ChangeStage(); //money bag system
        
new string[256];
        
format(stringsizeof(string), "* Today's jackpot has reached to $%s. Draw will be held at 18:00 ! Use /lotto to purchase a ticket.",FormatNumber(LottoJackpot));
        
SendClientMessageToAll(COLOR_LOTTO,string);
    }
    if(
GM[gtime]==1080)//18 mins
    
{
        
LottoDraw();
         
SendClientMessageToAll(COLOR_LOTTO,"* Tomorrow's Lotto Draw will be at 06:00. Type /lotto to purachase a Ticket.");
    }
    if(
GM[gtime]==1200)//20 mins
    
{
        
ChangeStage(); //money bag system
    
}
    if(
GM[gtime]==1440)//24 mins
    
{
        
ChangeStage();// money bag system.
        
GM[gday]++;
        
GM[gtime]=0;
        
format(daystringsizeof (daystring), "00:00");
        for(new 
0MAX_GANGSb++)
        {
            if(
Gang[b][gangStatus])
            {
                
saveGang(b);
            }
        }
        foreach(new 
Player)
        {
            
taxplayer(m);
        }
        
TextDrawSetString(GM[gtTD][1],daystring);
    }
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerTimeigminutesgseconds);
        }
    }
    return 
1;

In this i have Money bag and Lotto System problem is that after sometime since server started it starts getting bugged. and also it is getting mistimed and sometimes the function wont run..

Any Fix for it ?
Reply
#2

anyone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)