18.07.2018, 18:33
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":
MySql Accounts Banned:
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_WARNING, LOG_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(playerid, dialogid, response, listitem, inputtext[])
{
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 Cache: banuri = mysql_query(SQL, qstr);
if(cache_get_row_count() > 0)
{
new Security1[24];
new query22[256];
mysql_real_escape_string(UniversalVar[IdBanList][vNameBanList], Security1);
format(query22, sizeof(query22), "SELECT * FROM `bans` WHERE `PlayerName` = '%s'", Security1);
mysql_tquery(SQL, query22, "OnInfoBanCalled", "ds", playerid, UniversalVar[IdBanList][vNameBanList]);
return 1;
}
else
{
SendClientMessage(playerid, -1, "This player is not banned.");
}
cache_delete(banuri);
}
}
return 1;
}
return 1;
}
CMD:banlist( playerid, params[] )
{
new strt[226];
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0");
mysql_tquery(SQL, strt, "BanList", "d", playerid);
return 1;
}
FC BanList( playerid )
{
new szDialog[MAX_STRING], szDialog2[1024];
new liRows, liFields, OnName[ MAX_PLAYER_NAME ], OnName2[ MAX_PLAYER_NAME ], BBanDate[200];
cache_get_data( liRows, liFields );
strcat(szDialog2, "{FFFF00}ID\t{FFFF00}BanName\t{FFFF00}Admin\t{FFFF00}Ban Date\n");
for( new i = 0; i < liRows; i ++ )
{
cache_get_field_content( i, "PlayerName", OnName );
cache_get_field_content( i, "AdminName", OnName2 );
cache_get_field_content( i, "BanTimeDate", BBanDate, 1, 200 );
format(szDialog, sizeof(szDialog), "%d\t%s\t%s\t%s\n", i + 1, OnName, OnName2, BBanDate);
strcat(szDialog2, szDialog);
strmid(UniversalVar[i + 1][vNameBanList], OnName, 0, strlen(OnName), 255);
}
ShowPlayerDialog(playerid, DIALOG_BANLISTX, 5, "{6699FF}The List Of Players Banned:", szDialog2, "Select", "Exit");
return ( 1 );
}
FC OnInfoBanCalled(playerid, Player[])
{
new Rows, Fields, DDay, DMonth, DYear, BReason[ 100 ], BAdmin[ 100 ], BBanDate[ 200 ], BBanTime[ 100 ], BBanDays[ 100 ], BID[ 100 ], BIP[ 100 ];
cache_get_data( Rows, Fields, SQL );
// if( !Rows )
// return Eroare( playerid, "Nu exista nici un jucator cu acest nume, banat." );
cache_get_field_content( 0, "Reason", BReason, 1, 100 );// MOTIV
cache_get_field_content( 0, "AdminName", BAdmin, 1, 100 );// ADN N
cache_get_field_content( 0, "BanTimeDate", BBanDate, 1, 200 );
cache_get_field_content( 0, "Permanent", BBanTime, 1, 100 );
cache_get_field_content( 0, "Days", BBanDays, 1, 100 );
cache_get_field_content( 0, "IP", BIP, 1, 100 );
cache_get_field_content( 0, "ID", BID, 1, 100 );
sscanf(BBanDate, "p<->ddd", DYear, DMonth, DDay);
format(aswstring, sizeof(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", BReason, DDay, DMonth, DYear, BBanTime, BBanDays );
format(aswstring, sizeof(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", Player, BID, BIP, BAdmin, aswstring );
ShowPlayerDialog(playerid, DIALOG_InfoBan, DIALOG_STYLE_MSGBOX, "{FFFFFF}IBan Sistem:", aswstring, "OK", "");
return ( 1 );
}
public OnQueryError( errorid, error[ ], callback[ ], query[ ], connectionHandle )
{
print( "====================================================================" );
printf( "Error ID: %d, Error: %s", errorid, error );
printf( "Callback: %s", callback );
printf( "gQuery: %s", query );
print( "====================================================================" );
return 1;
}
PHP код:
CREATE TABLE IF NOT EXISTS `bans` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`PlayerName` varchar(30) NOT NULL,
`AdminName` varchar(30) NOT NULL,
`Reason` varchar(128) NOT NULL,
`IP` varchar(16) NOT NULL,
`Days` int(11) NOT NULL,
`IPBan` int(11) NOT NULL,
`Permanent` int(11) NOT NULL,
`Time` int(15) NOT NULL,
`BanTimeDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Active` int(11) NOT 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', 0, 1, 1, 0, '2018-07-08 13:57:03', 1),
(24, 'NULL', 'RaDuCu', 'very good', '109.98.95.74', 0, 1, 1, 0, '2018-07-08 14:04:11', 0),
(25, 'TheKing@', 'D3liryk..', 'hi', '5.13.188.173', 0, 0, 1, 0, '2018-07-11 19:22:33', 1),
(26, 'lider', 'Florinel_Gaming', 'hack (flyhack)', '89.136.253.172', 0, 1, 1, 0, '2018-07-11 19:37:52', 1),
(27, 'raducu', 'D3liryk..', 'hello', '0', 0, 0, 1, 0, '2018-07-11 21:20:08', 0),
(28, 'rebeca22', 'RaDuCu', 'test bass', '0', 0, 0, 1, 0, '2018-07-12 18:59:45', 1),
(29, 'rebeca223', 'RaDuCu2', 'the best', '0', 0, 0, 1, 0, '2018-07-12 18:59:45', 1),
(30, 'rebeca223', 'RaDuCu2', 'test 5', '0', 0, 0, 1, 0, '2018-07-12 18:59:45', 1),
(31, 'Alex12345', 'RaDuCu', 'ok', '62.121.69.232', 0, 1, 1, 0, '2018-07-13 10:04:57', 1);

