Ban command is bugged
#3

Here:
PHP код:
// Ban Checking system
    
new
        
string[6][24],
        
string2[156],
        
expire,
        
DIALOG[676]
    ;

    if(
SQL::RowExistsEx(""BANS_TABLE"""ban_username"GetName(playerid)))
    {
        new 
handle SQL::OpenEx(SQL::READ""BANS_TABLE"""ban_username"GetName(playerid));
        
SQL::ReadString(handle"ban_username"string[1], 24);
        
SQL::ReadString(handle"ban_ip"string[2], 24);
        
SQL::ReadString(handle"ban_by"string[3], 24);
        
SQL::ReadString(handle"ban_on"string[4], 24);
        
SQL::ReadString(handle"ban_reason"string[5], 24);
        
SQL::ReadInt(handle"ban_expire"expire);
        
SQL::Close(handle);

        if(
expire gettime() || expire == 0)
        {

            
strcat(DIALOG""white"Your account is banned from this server,\n\n");

            
format(string2sizeof(string2), ""white"Username: "red"%s\n"string[1]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"IP: "red"%s\n"string[2]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Banned by: "red"%s\n"string[3]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Reason: "red"%s\n"string[5]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Ban date: "red"%s\n"string[4]);
            
strcat(DIALOGstring2);

            new 
expire2[68];
            if(
expire == 0expire2 "PERMANENT";
            else 
expire2 ConvertTime(expire);
            
format(string2sizeof(string2), ""white"Timeleft: "red"%s\n\n"expire2);
            
strcat(DIALOGstring2);

            
strcat(DIALOG""white"If you think that you got banned wrongfully, please make an appeal on our forums. Visit svt-reloaded.com\n");
            
strcat(DIALOG"Make sure you saved this box by pressing F8.");

            
Dialog_Show(playeriddialogUnusedDIALOG_STYLE_MSGBOX"Notice"DIALOG"Close""");
            
DelayKick(playerid);

            return 
true;
        }
        else
        {
            
SQL::DeleteRowEx(""BANS_TABLE"""ban_username"GetName(playerid));
            
Server(playerid"Your account's ban has expired.");
        }
    }

    else if(
SQL::RowExistsEx(""BANS_TABLE"""ban_ip"GetIP(playerid)))
    {
        new 
handle SQL::OpenEx(SQL::READ""BANS_TABLE"""ban_ip"GetIP(playerid));
        
SQL::ReadString(handle"ban_username"string[1], 24);
        
SQL::ReadString(handle"ban_ip"string[2], 24);
        
SQL::ReadString(handle"ban_by"string[3], 24);
        
SQL::ReadString(handle"ban_on"string[4], 24);
        
SQL::ReadString(handle"ban_reason"string[5], 24);
        
SQL::ReadInt(handle"ban_expire"expire);
        
SQL::Close(handle);

        if(
expire gettime() || expire == 0)
        {

            
strcat(DIALOG""white"Your IP is banned from this server,\n\n");

            
format(string2sizeof(string2), ""white"Username: "red"%s\n"string[1]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"IP: "red"%s\n"string[2]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Banned by: "red"%s\n"string[3]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Reason: "red"%s\n"string[5]);
            
strcat(DIALOGstring2);

            
format(string2sizeof(string2), ""white"Ban date: "red"%s\n"string[4]);
            
strcat(DIALOGstring2);

            new 
expire2[68];
            if(
expire == 0expire2 "PERMANENT";
            else 
expire2 ConvertTime(expire);
            
format(string2sizeof(string2), ""white"Timeleft: "red"%s\n\n"expire2);
            
strcat(DIALOGstring2);

            
strcat(DIALOG""white"If you think that you got banned wrongfully, please make an appeal on our forums. Visit svt-reloaded.\n");
            
strcat(DIALOG"Make sure you saved this box by pressing F8.");

            
Dialog_Show(playeriddialogUnusedDIALOG_STYLE_MSGBOX"Notice"DIALOG"Close""");
            
DelayKick(playerid);

            return 
true;
        }
        else
        {
            
SQL::DeleteRowEx(""BANS_TABLE"""ban_username"GetName(playerid));
            
Server(playerid"Your IP's ban has expired.");
        }
    } 
Reply


Messages In This Thread
Ban command is bugged - by Fantje - 03.08.2016, 12:09
Re: Ban command is bugged - by oMa37 - 03.08.2016, 12:15
Re: Ban command is bugged - by Fantje - 03.08.2016, 12:17
Re: Ban command is bugged - by oMa37 - 03.08.2016, 12:18
Re: Ban command is bugged - by Fantje - 03.08.2016, 12:19
Re: Ban command is bugged - by oMa37 - 03.08.2016, 12:24
Re: Ban command is bugged - by Sew_Sumi - 03.08.2016, 12:24
Re: Ban command is bugged - by Fantje - 03.08.2016, 12:34
Re: Ban command is bugged - by Fantje - 03.08.2016, 12:37
Re: Ban command is bugged - by BoBiTza - 03.08.2016, 13:44

Forum Jump:


Users browsing this thread: 2 Guest(s)