problem command /BanList -
rollercaster - 17.07.2018
Hello, I have a problem viewing accounts banned in the dialog.. not exactly can not see everything.
is it possible to put "the next list? {Next Button}" ?
if anyone can help me, thank you very much.
I'm sorry I'm not so English
ScreenShot Exemple:
https://imgur.com/a/tHuWnIf
CODE MY SCRIPT:
Код HTML:
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;
}
stock 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 );
}
OnDialogResponse
if(dialogid == DIALOG_BANLISTX)
{
if(response)
{
if(listitem >= 0)
{
new IdBanList = listitem+1;
new qstr[256];
new cont = MySQLCheckAccount(UniversalVar[IdBanList][vNameBanList]);
if(cont == 0) return SCM(playerid,COLOR_WHITE,"{FFB870}Nu exista nici un jucator cu acest nume, banat.");
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, COLOR_LIGHTRED, "This player is not banned.");
}
cache_delete(banuri);
}
}
return 1;
}
Re: problem command /BanList -
Calisthenics - 17.07.2018
MySQL provides LIMIT clause. Have a variable that holds the total number of bans. Then you can use offset and items per page.
it will select 10 items starting from rowid 20. So basically you have a variable that stores page.
pawn Код:
..., "SELECT ... LIMIT %d,%d", page * ITEMS_PER_PAGE, ITEMS_PER_PAGE);
to determinate if there is "Next Page":
pawn Код:
if (page * ITEMS_PER_PAGE > total_bans)
{
strcat(dialog_string_here, "Next Page");
}
Re: problem command /BanList -
rollercaster - 17.07.2018
but here I do not understand how they do exactly.. I tried, but it did not come out
I do not understand how to do this with the next page
Re: problem command /BanList -
Calisthenics - 17.07.2018
Follow my steps exactly and do an attempt. If it doesn't work, you can then post your code so we can look at it and fix it.
Re: problem command /BanList -
rollercaster - 18.07.2018
My Tested Script:
https://imgur.com/a/Uu9w3WB
My Script:
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 MAX_RESULTS 5
#define GetPageCount(%0,%1) floatround(%1 / %0, floatround_floor) + 1
enum
{
DIALOG_BANLISTX,
DIALOG_InfoBan,
DIALOG_OK,
DIALOG_BAN_LIST
}
new SQL = -1, EroareDeConectare = 0;
new aswstring[2400];
new pLastPage[MAX_PLAYERS];
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 OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_OK: return 1;
case DIALOG_BAN_LIST:
{
if(!response) return 1;
else if(response)
{
pLastPage[playerid] ++;
ShowBanList(playerid);
}
}
}
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 );
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 );
}
CMD:banlist(playerid, params[])
{
new strt[226];
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0");
mysql_tquery(SQL, strt, "ShowBanList", "");
pLastPage[playerid] = 1;
return 1;
}
FC ShowBanList(playerid)
{
new OnName[ MAX_PLAYER_NAME ], OnName2[ MAX_PLAYER_NAME ], BBanDate[200];
new IDD = cache_num_rows();
new title[128], string[300], pages = GetPageCount(MAX_RESULTS, IDD) ,resultcount = ((MAX_RESULTS * pLastPage[playerid]) - MAX_RESULTS), bool:nextpage = false;
strcat(string, "ID\tName\tAName\tDate");
new sdg[226];
format(sdg, sizeof(sdg), "%d | %d", pages, IDD);
SCM(playerid, -1, sdg);
for(new i = resultcount; i < IDD; i ++)
{
resultcount ++;
cache_get_field_content( i, "PlayerName", OnName );
cache_get_field_content( i, "AdminName", OnName2 );
cache_get_field_content( i, "BanTimeDate", BBanDate, 1, 200 );
if(resultcount <= MAX_RESULTS * pLastPage[playerid])
{
format(string, sizeof(string), "%s\n%d\t%s\t%s\t%s", string, resultcount, OnName, OnName2, BBanDate);
// SCM(playerid, -1, string);
}
if(resultcount > MAX_RESULTS * pLastPage[playerid])
{
nextpage = true;
break;
}
}
format(title, sizeof(title), "{FFFF00}Bans - Page %d of %d", pLastPage[playerid], pages);
if(nextpage) return ShowPlayerDialog(playerid, DIALOG_BAN_LIST, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Next", "Close");
return ShowPlayerDialog(playerid, DIALOG_OK, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Select", "Cancel");
}
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;
}
Re: problem command /BanList -
Calisthenics - 18.07.2018
When server starts, count total bans to store.
pawn Код:
new gTotalBans;
//OnGameModeInit
mysql_tquery(SQL, "SELECT COUNT(*) FROM bans;", "OnTotalBansNumberLoad", "");
forward OnTotalBansNumberLoad();
public OnTotalBansNumberLoad()
{
gTotalBans = cache_get_row_int(0, 0, SQL);
}
Now the page part. For testing purposes, set MAX_RESULTS to 3:
pawn Код:
#define MAX_RESULTS 3
...
//command /banlist:
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0 LIMIT 0,%d", MAX_RESULTS);
mysql_tquery(SQL, strt, "ShowBanList", "d", playerid);
pawn Код:
//OnPlayerConnect:
pLastPage[playerid] = 0;
pawn Код:
//ShowBanList:
pLastPage[playerid] = 1; //set first page at top
new OnName[ MAX_PLAYER_NAME ], OnName2[ MAX_PLAYER_NAME ], BBanDate[200];
new title[128], string[300];
string = "ID\tName\tAName\tDate";
for(new i = 0, j = cache_num_rows(); i < j; 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(string, sizeof(string), "%s\n%d\t%s\t%s\t%s", string, i + 1, OnName, OnName2, BBanDate);
}
if (gTotalBans > pLastPage[playerid] * MAX_RESULTS) //Total bans 5 > 3 (page 1 * 3 items per page) so last option is "Next Page"
{
strcat(string, "Next Page");
}
format(title, sizeof(title), "{FFFF00}Bans - Page %d of %d", pLastPage[playerid], floatround(float(gTotalBans) / float(MAX_RESULTS), floatround_ceil));
There are total of 5 bans, it shows 3 and the last item (4th) is "Next Page". In OnDialogResponse, you can do:
pawn Код:
if (response)
{
if (MAX_RESULTS + 1 == listitem)
{
// player selected "Next Page");
new strt[226];
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0 LIMIT %d,%d", pLastPage[playerid] * MAX_RESULTS, MAX_RESULTS);
mysql_tquery(SQL, strt, "ShowBanList", "d", playerid);
pLastPage[playerid]++;
}
}
else pLastPage[playerid] = 0;
But this method needs to increase gTotalBans every time a player is banned.
Re: problem command /BanList -
rollercaster - 18.07.2018
Not working..
ScreenShot:
https://imgur.com/a/9hcqr65
Script:
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 MAX_RESULTS 3
new gTotalBans;
new pLastPage[MAX_PLAYERS];
enum
{
DIALOG_BAN_LIST2
}
new SQL = -1;
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)
{
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
{
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");
mysql_tquery(SQL, "SELECT COUNT(*) FROM bans;", "OnTotalBansNumberLoad", "");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_BAN_LIST2:
{
if (response)
{
if (MAX_RESULTS + 1 == listitem)
{
// player selected "Next Page");
new strt[226];
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0 LIMIT %d,%d", pLastPage[playerid] * MAX_RESULTS, MAX_RESULTS);
mysql_tquery(SQL, strt, "ShowBanList2", "d", playerid);
pLastPage[playerid]++;
}
}
else pLastPage[playerid] = 0;
}
}
return 1;
}
FC OnTotalBansNumberLoad()
{
gTotalBans = cache_get_row_int(0, 0, SQL);
}
CMD:banlist2(playerid, params[])
{
new strt[126];
pLastPage[playerid] = 0;
format(strt, sizeof(strt), "SELECT * FROM `bans` WHERE `ID` > 0 LIMIT 0,%d", MAX_RESULTS);
mysql_tquery(SQL, strt, "ShowBanList2", "d", playerid);
return 1;
}
FC ShowBanList2(playerid)
{
pLastPage[playerid] = 1; //set first page at top
new OnName[ MAX_PLAYER_NAME ], OnName2[ MAX_PLAYER_NAME ], BBanDate[200];
new title[128], string[300];
string = "ID\tName\tAName\tDate";
for(new i = 0, j = cache_num_rows(); i < j; 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(string, sizeof(string), "%s\n%d\t%s\t%s\t%s\n", string, i + 1, OnName, OnName2, BBanDate);
}
if (gTotalBans > pLastPage[playerid] * MAX_RESULTS) //Total bans 5 > 3 (page 1 * 3 items per page) so last option is "Next Page"
{
strcat(string, "Next Page");
}
format(title, sizeof(title), "{FFFF00}Bans - Page %d of %d", pLastPage[playerid], floatround(float(gTotalBans) / float(MAX_RESULTS), floatround_ceil));
ShowPlayerDialog(playerid, DIALOG_BAN_LIST2, DIALOG_STYLE_TABLIST_HEADERS, title, string, "OK", "Close");
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;
}
Re: problem command /BanList -
Calisthenics - 18.07.2018
The code I provided was for the "Next Page" in dialog. When you select last item which is "Next Page" should show the next results. If what you want is selecting any ban record to do something, your script is empty.
Re: problem command /BanList -
rollercaster - 18.07.2018
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_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;
}
MySql Accounts Banned:
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);
Re: problem command /BanList -
rollercaster - 19.07.2018
I've resolved with the next page:
https://imgur.com/a/h4DY4CV
but how do I select an item in the dialog?
when I choose something gives me the next page ..