Server Crashes all the time
#8

i found out is because of the bans. When someone gets banned and come back in server crashes.

PHP код:
stock CheckBanList(playerid)
{
    new 
vas[32], unbandatebool:banip[32];
    
GetPlayerIp(playeridip32);
    
format(querysizeof(query), "SELECT * FROM bans WHERE name = '%s'"sendername(playerid));
    
mysql_query(query);
     
mysql_store_result();
    if(
mysql_fetch_row_format(query))
    {
        
mysql_get_field("unbandate", var); unbandate strval(var);
        if(
unbandate gettime() > 0ban true;
    }
    else
    {
        
format(querysizeof(query), "DELETE FROM bans WHERE name = '%s'"sendername(playerid));
        
mysql_query(query);
    }
    
format(querysizeof(query), "SELECT * FROM bans WHERE ip = '%s'"ip);
    
mysql_query(query);
    
mysql_store_result();
    if(
mysql_fetch_row_format(query))
    {
        
mysql_get_field("unbandate", var); unbandate strval(var);
        if(
unbandate gettime() > 0)
        {
            
ban true;
        }
        else
        {
            
format(querysizeof(query), "DELETE FROM bans WHERE ip = '%s'"ip);
            
mysql_query(query);
        }
    }
    if(
ban == true)
    {
          
convert((unbandate-gettime())*1000,UBMin,UBSec,UBMSec);
         
UBHour UBMin/60;
          
UBMin UBMin%60;
          
UBDay UBHour/24;
          
UBHour UBHour%24;

          new 
data[16], whobanned[32], reason[32];
          
mysql_get_field("bandate"data);
          
mysql_get_field("unbandate"vas); unbandate strval(vas);
          
mysql_get_field("whobanned"whobanned);
          
mysql_get_field("reason"reason);

         if(
UBMin == 59)
         {
             
UBHour++;
         }
          if(
UBHour == 23)
        {
             
UBDay++;
             
UBHour 0;
         }

        
format(string384,"Jusu konts: %s{FFFFFF}\n\
        Statuss: {FF9900}Blokets{FFFFFF}\n\
        Noblokets: %s\n\
          Atblokets pec: %d dienam un %d stundam\n\
        Blokeja: %s\n\
        Blokeshanas iemesls: %s\n\
        "
,sendername(playerid),dataUBDay,UBHourwhobannedreason);

        
SPD(playeridD_NULLDIALOG_STYLE_MSGBOX"Banned"string"Aizvert""");
         
Kick(playerid);
    }
    
mysql_free_result();

Reply


Messages In This Thread
Server Crashes all the time - by cuemur - 23.04.2015, 12:13
Re: Server Crashes all the time - by AberKane - 23.04.2015, 12:22
Re: Server Crashes all the time - by cuemur - 23.04.2015, 12:31
Re: Server Crashes all the time - by Nirzor - 23.04.2015, 12:48
Re: Server Crashes all the time - by AberKane - 23.04.2015, 12:49
Re: Server Crashes all the time - by cuemur - 23.04.2015, 16:17
Re: Server Crashes all the time - by AberKane - 23.04.2015, 16:24
Re: Server Crashes all the time - by cuemur - 23.04.2015, 17:59
Re: Server Crashes all the time - by AberKane - 23.04.2015, 19:39

Forum Jump:


Users browsing this thread: 1 Guest(s)