problem command /BanList
#9

Here is the script with all the functions but on several banned accounts it does not show everything
And how can I do it next page?
or if someone helps me I am grateful
I also give money only to solve the problem

My default code "No next page":

PHP код:
#include <a_samp>
#include <sscanf2>
#include <a_mysql>
#include <zcmd>
#define FC%0(%1) forward%0(%1); public%0(%1)
#define SCM SendClientMessage
#define MAX_STRING 2400
#define GetPageCount(%0,%1) floatround(%1 / %0, floatround_floor) + 1
enum
{
    
DIALOG_BANLISTX,
    
DIALOG_InfoBan
}
new 
aswstring[2400];
new 
SQL = -1,    EroareDeConectare 0;
enum VarInfo
{
    
vName[255],
    
vNameBanList[255]
};
new 
UniversalVar[1000][VarInfo];
main()
{
   print(
"New Project");
}
public 
OnGameModeInit()
{
    
mysql_log(LOG_ERROR LOG_WARNINGLOG_TYPE_HTML);
    
SQL mysql_connect("localhost","root","test","");
    if(
mysql_errno(SQL) != 0)
    {
        
EroareDeConectare 0;
        print( 
" ");
        print( 
" ");
        print( 
" ");
        print( 
"          #########################################################" );
        print( 
"          #                                                       #" );
        print( 
"          #            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _          #" );
        print( 
"          #           _I_N_F_O_ _S_E_R_V_E_R_ _L_O_A_D_S_         #" );
        print( 
"          #                                                       #" );
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #   MySQL: Failed to connect to the database! (Error)   #");
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #   Shut up as something went wrong, please check!      #" );
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #   Thank you for using Script Gold.                    #" );
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #                                                       #" );
        print( 
"          #                                                       #" );
        print( 
"          #########################################################" );
        print( 
" ");
        print( 
" ");
    }
    else
    {
        
EroareDeConectare 1;
        print( 
" ");
        print( 
" ");
        print( 
" ");
        print( 
"          #########################################################" );
        print( 
"          #                                                       #" );
        print( 
"          #            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _          #" );
        print( 
"          #           _I_N_F_O_ _S_E_R_V_E_R_ _L_O_A_D_S_         #" );
        print( 
"          #                                                       #" );
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #   MySQL: Connect to the successful database!          #");
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #   Thank you for using Script Gold.                    #" );
        print( 
"          #  __________________________________________________   #" );
        print( 
"          #                                                       #" );
        print( 
"          #########################################################" );
        print( 
" ");
        print( 
" ");
    }
    
SetGameModeText("NEW Project");
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    if(
EroareDeConectare == 0)
    {
        return 
1;
    }
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_BANLISTX)
    {
        if(
response)
        {
            if(
listitem >= 0)
            {
                   new 
IdBanList listitem+1;
                new 
qstr[256];
                
format(qstr,sizeof(qstr),"SELECT * FROM bans WHERE `PlayerName`='%s' AND `Active`='1'"UniversalVar[IdBanList][vNameBanList]);
                new 
Cachebanuri mysql_query(SQLqstr);
                if(
cache_get_row_count() > 0)
                {
                    new 
Security1[24];
                    new 
query22[256];
                    
mysql_real_escape_string(UniversalVar[IdBanList][vNameBanList], Security1);
                    
format(query22sizeof(query22), "SELECT * FROM `bans` WHERE `PlayerName` = '%s'"Security1);
                    
mysql_tquery(SQLquery22"OnInfoBanCalled""ds"playeridUniversalVar[IdBanList][vNameBanList]);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playerid, -1"This player is not banned.");
                }
                
cache_delete(banuri);
            }
        }
        return 
1;
    }
    return 
1;
}
CMD:banlistplayeridparams[] )
{
    new 
strt[226];
    
format(strtsizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0");
    
mysql_tquery(SQLstrt"BanList""d"playerid);
    return 
1;
}
FC BanListplayerid )
{
    new 
szDialog[MAX_STRING], szDialog2[1024];
    new 
liRowsliFieldsOnNameMAX_PLAYER_NAME ], OnName2MAX_PLAYER_NAME ], BBanDate[200];
    
cache_get_dataliRowsliFields );
    
strcat(szDialog2"{FFFF00}ID\t{FFFF00}BanName\t{FFFF00}Admin\t{FFFF00}Ban Date\n");
    for( new 
0liRows++ )
    {
        
cache_get_field_contenti"PlayerName"OnName );
        
cache_get_field_contenti"AdminName"OnName2 );
        
cache_get_field_contenti"BanTimeDate"BBanDate1200 );
        
format(szDialogsizeof(szDialog), "%d\t%s\t%s\t%s\n"1OnNameOnName2BBanDate);
        
strcat(szDialog2szDialog);
        
strmid(UniversalVar[1][vNameBanList], OnName0strlen(OnName), 255);
    }
    
ShowPlayerDialog(playeridDIALOG_BANLISTX5"{6699FF}The List Of Players Banned:"szDialog2"Select""Exit");
    return ( 
);
}
FC OnInfoBanCalled(playeridPlayer[])
{
    new 
RowsFieldsDDayDMonthDYearBReason100 ], BAdmin100 ], BBanDate200 ], BBanTime100 ], BBanDays100 ], BID100 ], BIP100 ];
    
cache_get_dataRowsFieldsSQL );
//    if( !Rows )
//        return Eroare( playerid, "Nu exista nici un jucator cu acest nume, banat." );
    
cache_get_field_content0"Reason"BReason1100 );// MOTIV
    
cache_get_field_content0"AdminName"BAdmin1100 );// ADN N
    
cache_get_field_content0"BanTimeDate"BBanDate1200 );
    
cache_get_field_content0"Permanent"BBanTime1100 );
    
cache_get_field_content0"Days"BBanDays1100 );
    
cache_get_field_content0"IP"BIP1100 );
    
cache_get_field_content0"ID"BID1100 );
    
sscanf(BBanDate"p<->ddd"DYearDMonthDDay);
    
format(aswstringsizeof(aswstring), "{FF0000}- {FFFFFF}Cu motivul: {FF0000}'{FFFFFF}%s{FF0000}'\n{FF0000}- {FFFFFF}Data Banarii: {FF0000}'{FFFFFF}%d/%d/%d\n{FF0000}- {FFFFFF}Ban permanent (0= NU 1= DA): {FF0000}'{FFFFFF}%s{FF0000}'\n{FF0000}- {FFFFFF}UnBan dupa: {FF0000}'{FFFFFF}%s{FF0000}' {FFFFFF}zile"BReasonDDayDMonthDYearBBanTimeBBanDays );
    
format(aswstringsizeof(aswstring), "{FF0000}'{FFFFFF} Detalii jucator Banat: {FF0000}'{FF0000}%s{FF0000}'\n\n{FF0000}- {FFFFFF}ID Ban: {FF0000}'{FFFFFF}%s{FF0000}'\n{FF0000}- {FFFFFF}IP jucator Banat: {FF0000}'{FFFFFF}%s{FF0000}'\n{FF0000}- {FFFFFF}De catre Adminul: {FF0000}'{FFFFFF}%s{FF0000}'\n%s"PlayerBIDBIPBAdminaswstring );
    
ShowPlayerDialog(playeridDIALOG_InfoBanDIALOG_STYLE_MSGBOX"{FFFFFF}IBan Sistem:"aswstring"OK""");
    return ( 
);
}
public 
OnQueryErrorerroriderror[ ], callback[ ], query[ ], connectionHandle )
{
    print( 
"====================================================================" );
    
printf"Error ID: %d, Error: %s"erroriderror );
    
printf"Callback: %s"callback );
    
printf"gQuery: %s"query );
    print( 
"====================================================================" );
    return 
1;

MySql Accounts Banned:

PHP код:
CREATE TABLE IF NOT EXISTS `bans` (
  `
IDint(11NOT NULL AUTO_INCREMENT,
  `
PlayerNamevarchar(30NOT NULL,
  `
AdminNamevarchar(30NOT NULL,
  `
Reasonvarchar(128NOT NULL,
  `
IPvarchar(16NOT NULL,
  `
Daysint(11NOT NULL,
  `
IPBanint(11NOT NULL,
  `
Permanentint(11NOT NULL,
  `
Timeint(15NOT NULL,
  `
BanTimeDatetimestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `
Activeint(11NOT NULL,
  
PRIMARY KEY (`ID`)
ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
INSERT INTO `bans` (`ID`, `PlayerName`, `AdminName`, `Reason`, `IP`, `Days`, `IPBan`, `Permanent`, `Time`, `BanTimeDate`, `Active`) VALUES
(23'EnErGizanT''RaDuCu''test''109.98.164.144'0110'2018-07-08 13:57:03'1),
(
24'NULL''RaDuCu''very good''109.98.95.74'0110'2018-07-08 14:04:11'0),
(
25'TheKing@''D3liryk..''hi''5.13.188.173'0010'2018-07-11 19:22:33'1),
(
26'lider''Florinel_Gaming''hack (flyhack)''89.136.253.172'0110'2018-07-11 19:37:52'1),
(
27'raducu''D3liryk..''hello''0'0010'2018-07-11 21:20:08'0),
(
28'rebeca22''RaDuCu''test bass''0'0010'2018-07-12 18:59:45'1),
(
29'rebeca223''RaDuCu2''the best''0'0010'2018-07-12 18:59:45'1),
(
30'rebeca223''RaDuCu2''test 5''0'0010'2018-07-12 18:59:45'1),
(
31'Alex12345''RaDuCu''ok''62.121.69.232'0110'2018-07-13 10:04:57'1); 
Reply


Messages In This Thread
problem command /BanList - by rollercaster - 17.07.2018, 16:56
Re: problem command /BanList - by Calisthenics - 17.07.2018, 17:48
Re: problem command /BanList - by rollercaster - 17.07.2018, 18:04
Re: problem command /BanList - by Calisthenics - 17.07.2018, 21:57
Re: problem command /BanList - by rollercaster - 18.07.2018, 05:02
Re: problem command /BanList - by Calisthenics - 18.07.2018, 08:20
Re: problem command /BanList - by rollercaster - 18.07.2018, 15:11
Re: problem command /BanList - by Calisthenics - 18.07.2018, 16:34
Re: problem command /BanList - by rollercaster - 18.07.2018, 18:33
Re: problem command /BanList - by rollercaster - 19.07.2018, 12:10

Forum Jump:


Users browsing this thread: 1 Guest(s)