Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Query was empty

$
0
0
Hello there i have a problem with this query.
When a player join the server the system will
check automatically if he/she is banned or not.
So the problem is that now, when a player join the
server in my server-log.txt appears this error:

PHP Code:

[OnQueryError (1065Query was empty, BanListCheck)] 

BanListCheck function:
PHP Code:

function BanListCheckplayerid )
{
    
eString] = EOS;
    new 
count_rowsbField][ 512 ], query1000 ], Days];
    
cache_get_row_countcount_rows );

    if( 
count_rows )
    {
         
cache_get_value_int0"BanExpire"Days] );
        
cache_get_value_name0"Reason"bField] );
        
cache_get_value_name0"Admin"bField] );
        
cache_get_value_name0"BanDate"bField] );
        
cache_get_value_name0"BanTime"bField] );

        
Days] = gettime( );
        
Days] = Days] - Days];
        
Days] = floatround( ( ( Days] / 24 ) /60 ) / 60 );

        if( 
Days] == -)
        {
              for( new 
030++ )
                
SendClientMessageplayerid, ~1" " );

            
formateStringsizeofeString ), "{FF1C1C}You are banned on this server !\n\n{FFFFFF}Nickname: {41C63F}%s\n\n{FFFFFF}IP: {D6D6D6}%s\n\n{FFFFFF}Banned by: {FF1C1C}%s\n\n{FFFFFF}Reason: {41C63F}%s\n\n\
            {FFFFFF}Ban Date: {41C63F}%s\n\n{FFFFFF}Ban Time: {41C63F}%s\n\n{FFFFFF}Ban Days: {41C63F}Permanent\n\n{FFFFFF}If you want to get unbanned visit {FF1C1C}<< www.hype-zone.ro >>\n{FF1C1C}** {FFFFFF}Take a screenshot to this dialog."
PlayerNameplayerid ), GetPlayerIPExplayerid ), bField], bField], bField], bField] );
            
ShowPlayerDialogplayeridDIALOG_COMMONDIALOG_STYLE_MSGBOX"{FFFFFF}Ban Details:"eString"OK""");

            
KickExplayerid );
        }
        else if( 
gettime( ) >= Days] )
        {
            
mysql_formatdatabasequerysizeofquery ), "UPDATE `Bans` SET `BanExpire` = '0' WHERE `Name` = '%s'"PlayerNameplayerid ) );
            
mysql_tquerydatabasequery"""" );
        }
        else if( 
Days] > )
        {
              for( new 
030++ )
                
SendClientMessageplayerid, ~1" " );

              
formateStringsizeofeString ), "{FF1C1C}You are banned on this server !\n\n{FFFFFF}Nickname: {41C63F}%s\n\n{FFFFFF}IP: {D6D6D6}%s\n\n{FFFFFF}Banned by: {FF1C1C}%s\n\n{FFFFFF}Reason: {41C63F}%s\n\n\
            {FFFFFF}Ban Date: {41C63F}%s\n\n{FFFFFF}Ban Time: {41C63F}%s\n\n{FFFFFF}Banned for: {41C63F}%d day(s)\n\n\
            {FFFFFF}If you want to get unbanned visit {FF1C1C}<< www.hype-zone.ro >>\n{FF1C1C}** {FFFFFF}Take a screenshot to this dialog."
PlayerNameplayerid ), GetPlayerIPExplayerid ), bField], bField], bField], bField], Days]);
            
ShowPlayerDialogplayeridDIALOG_COMMONDIALOG_STYLE_MSGBOX"{FFFFFF}Ban Details:"eString"OK""");

            
KickExplayerid );
        }
    }
    return 
1;


This function is called at OnPlayerConnect public, just here:
PHP Code:

public OnPlayerConnectplayerid )
{
     new 
conn_ip16 ];
    
GetPlayerIpplayeridconn_ip16 );

    new 
query1000 ];
    
mysql_formatdatabasequerysizeofquery ), "SELECT * FROM `Bans` WHERE `IP` LIKE '%%%s%%%' OR `Name` = '%s'"conn_ipPlayerNameplayerid ) );
    
mysql_tquerydatabasequery"BanListCheck""i"playerid );
    
    .
    .
    .
    
    
bla bla
    
return 1;


I don't know how to fix this. If you can help me please reply.
I am using: MySQL R41-2.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>