AES Flags by Bonus SQL

Сообщения
282
Реакции
34
Помог
3 раз(а)
Ошибка
amx_admins_servers is empty after player spends points to receive flag
ОС
Linux
Amx Mod X
AMX Mod X 1.10.0.5453 (http://www.amxmodx.org)
Билд
reHLDS 3.12.0.780-dev
ReGamedll
5.21.0.556
Версия Metamod
1.31
Список метамодулей
[ 1] SafeNameAndChat  RUN   -    SafeNameAndChat.so          v1.1             ini  ANY   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.137 ini Start Never
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5453 ini Start ANY
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[10] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.1 ini Start ANY
[11] Admins Kit RUN - adminskit_amxx_i386.so v2.1.0 pl3 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[13] MySQL RUN - mysql_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[15] Engine RUN - engine_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[16] ReAPI RUN - reapi_amxx_i386.so v5.22.0.254-dev pl3 ANY Never
[17] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[19] GeoIP RUN - geoip_amxx_i386.so v1.10.0.5453 pl3 ANY ANY
[20] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl3 ANY Never
20 plugins, 20 running
Список плагинов
[  1] 0   FreshBans               1.4.6b      kanagava          unknown                          fresh_bans_  running  
[ 2] 1 ScreenMaker 1.1 neygomon screen_make running
[ 3] 2 CSStatsX SQL 0.7.4+2 serfreeman1337 unknown csstatsx_sq debug
[ 4] 3 AES: StatsX 0.5.9 [REA serfreeman1337/s unknown aes_statsx_ running
[ 5] 4 Admin Base 1.10.0.545 AMXX Dev Team admin.amxx running
[ 6] 5 AdminListen 2.3x /dev/ urandom / unknown adminlisten running
[ 7] 6 Admin Commands 1.10.0.545 AMXX Dev Team admincmd.am running
[ 8] 7 Admin Help 1.10.0.545 AMXX Dev Team adminhelp.a running
[ 9] 8 Multi-Lingual System 1.10.0.545 AMXX Dev Team multilingua running
[ 10] 9 Menus Front-End 1.10.0.545 AMXX Dev Team menufront.a running
[ 11] 10 Commands Menu 1.10.0.545 AMXX Dev Team cmdmenu.amx running
[ 12] 11 Players Menu 1.10.0.545 AMXX Dev Team plmenu.amxx running
[ 13] 12 Pause Plugins 1.10.0.545 AMXX Dev Team pausecfg.am running
[ 14] 13 Maps Menu 1.10.0.545 AMXX Dev Team mapsmenu.am running
[ 15] 14 Plugin Menu 1.10.0.545 AMXX Dev Team pluginmenu. running
[ 16] 15 Anti Flood 1.10.0.545 AMXX Dev Team antiflood.a running
[ 17] 16 Scrolling Message 1.10.0.545 AMXX Dev Team scrollmsg.a running
[ 18] 17 Info. Messages 1.10.0.545 AMXX Dev Team imessage.am running
[ 19] 18 Admin Votes 1.10.0.545 AMXX Dev Team adminvote.a running
[ 20] 19 Map Manager: Core 3.1.5 Mistrick unknown map_manager running
[ 21] 20 Map Manager: Scheduler 0.1.10 Mistrick unknown map_manager running
[ 22] 21 Map Manager: Rtv 0.1.1 Mistrick unknown map_manager running
[ 23] 22 Map Manager: Nominatio 0.2.1 Mistrick unknown map_manager running
[ 24] 23 Map Manager: BlockList 0.0.4 Mistrick unknown map_manager running
[ 25] 24 Map Manager: Online so 0.0.4 Mistrick unknown map_manager running
[ 26] 25 Map Manager: Effects 0.1.1 Mistrick unknown map_manager running
[ 27] 26 Map Manager: Informer 0.0.5 Mistrick unknown map_manager running
[ 28] 27 Map Manager: Sounds 0.0.2 Mistrick unknown map_manager running
[ 29] 28 Map Manager: Advanced 0.1.0 Mistrick unknown map_manager running
[ 30] 29 Map Manager: Priority 0.0.2 Mistrick unknown map_manager running
[ 31] 30 Stats Configuration 1.10.0.545 AMXX Dev Team statscfg.am running
[ 32] 31 Unreal Cheater Cry 1.0.11 Karaulov unknown unreal_chea running
[ 33] 32 [Advanced Slot Reserva 2.2 Shadows Adi unknown advanced_sl running
[ 34] 33 Temporary Flags 1.0 drag1c unknown temp_flags. running
[ 35] 34 Restrict Weapons 1.10.0.545 AMXX Dev Team restmenu.am running
[ 36] 35 [ReAPI] Best player of 1.1.2 F@nt0M best_player running
[ 37] 36 Say me and Say hp 1.4 neygomon sayme_reapi running
[ 38] 37 Std Admin Color Chat 1.1.1 Van der Cal unknown kgb_admin_c running
[ 39] 38 Deluxe Admin Chat 1.7 Hell Phoenix/EJL unknown amx_ejl_adm running
[ 40] 39 Unreal Spawn Fixer 1.1 karaulov unknown spawnfix.am running
[ 41] 40 Task Scheduler 0.2 JustinHoMi unknown task_schedu running
[ 42] 41 Reset Score 1.0 Silenttt unknown ressetscore running
[ 43] 42 Autoresponder/Advertis 0.5 MaximusBrood unknown ad_manager. running
[ 44] 43 AFK Control ReNew 1.2(a) neygomon unknown afk_control running
[ 45] 44 Bypass Guard 1.0.1 mx?! bypass_guar running
[ 46] 45 [BG] Provider: GeoIP 0.2 mx?! bg_provider running
[ 47] 46 Restrict Names 1.2a Brad Jones unknown restrictnam running
[ 48] 47 Admin Commands Log 1.2.1 twisterniq https://github.com/twisterniq/a admin_comma running
[ 49] 48 Exec 1.0 ToXiC unknown exec.amxx running
[ 50] 49 Admin ESP 1.0 neygomon unknown admin_esp.a running
[ 51] 50 Models Replacement 0.0.2 ConnorMcLeod | V unknown models_repl running
[ 52] 51 [ReAPI] Slay Losers 1.0 drag1c unknown reapi_slayl running
[ 53] 52 AMXX Gag 1.5.0 xPaw & Exolent amxgag.amxx running
[ 54] 53 [ReAPI] No Team Flash 0.0.2 Vaqtincha unknown no_team_fla running
[ 55] 54 WalkGuard 1.3.2 mogel unknown walkguard_t running
[ 56] 55 Music Round End 1.2.7 Jumper unknown MusicRoundE running
[ 57] 56 ReAimDetector API 0.2.2 ReHLDS Team unknown reaimdetect running
[ 58] 57 Ping Checker 26.0.1 RC1 h1k3 unknown ping_checke running
[ 59] 58 Frags Counter 1.0 CHEL74 unknown frags_count running
[ 60] 59 GameName Wins 1.0.4 twisterniq https://github.com/twisterniq/a gamename_wi running
[ 61] 60 Mode 2x2 2.5re s1lent mode.amxx running
[ 62] 61 [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amx running
[ 63] 62 Auto Team Balance Adva 1.5.1 Radius unknown auto_team_b running
[ 64] 63 [ReAPI] Block Fire in 3.1.0 F@nt0M unknown reapi_block running
[ 65] 64 Auto Set Steam Flag 1.0.0 drag1c unknown steam_free_ running
[ 66] 65 Bullet Damage 1.0 drag1c bullet_dama running
[ 67] 66 Weapon skins 1.0 drag1c unknown skins.amxx running
[ 68] 67 VIP and SVIP 2.5.11 drag1c unknown csgo_vip_sv running
[ 69] 68 CS:GO Molotov 2.5.11 DynamicBits & O' unknown csgo_moloto running
[ 70] 69 Advanced Kill Assists 1.3c Xelson kill_assist running
[ 71] 70 Custom Smoke 1.07 bionext custom_smok running
[ 72] 71 Snow WarmUp 0.3 bizon unknown reapi_snow_ running
[ 73] 72 Quick Defuse Bomb 0.0.2 Albertio unknown quick_defus running
[ 74] 73 Style C4 Timer 3.1 OciXCrom unknown crx_c4timer running
[ 75] 74 Discord Connect 1.0 drag1c unknown discord.amx running
[ 76] 75 Advanced Experience Sy 0.5.9 [REA serfreeman1337/s unknown aes_main.am running
[ 77] 76 AES: CStrike Addon 0.5.9 [REA serfreeman1337/s unknown aes_exp_cst running
[ 78] 77 AES: Informer 0.5.9 [REA serfreeman1337/s unknown aes_informe running
[ 79] 78 AES: Admin Tools 0.5.9 [REA serfreeman1337/s unknown aes_exp_edi running
[ 80] 79 AES: Bonus System 0.5.9 Vega serfreeman1337/s unknown aes_bonus_s running
[ 81] 80 AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s unknown aes_bonus_c running
[ 82] 81 AES: Status Info 0.1 serfreeman1337 unknown aes_status_ running
[ 83] 82 Revive Teammates: Core 0.11.0 ufame & Albertio unknown rt_core.amx running
[ 84] 83 Revive Teammates: Plan 0.11.0 ufame & Albertio unknown rt_planting running
[ 85] 84 Revive Teammates: Rest 0.11.0 ufame & Albertio unknown rt_restrict running
[ 86] 85 Revive Teammates: Time 0.11.0 ufame & Albertio unknown rt_timer.am running
[ 87] 86 Revive Teammates: Effe 0.11.0 ufame & Albertio unknown rt_effects. running
[ 88] 87 Revive Teammates: Soun 0.11.0 ufame & Albertio unknown rt_sounds.a running
[ 89] 88 Revive Teammates: Bonu 0.11.0 ufame & Albertio unknown rt_bonus.am running
89 plugins, 89 running
Автор плагина
Sonyx
Версия плагина
0.2
Исходный код
#include <amxmodx>
#include <sqlx>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

forward amxbans_sql_initialized(Handle:sqlTuple, const dbPrefix[]);
forward fbans_sql_connected(Handle:sqlTuple);
forward lite_bans_sql_init(Handle:sqlTuple);

enum (+=1) {
NONE = 0,
AMX,
FB,
LB
}

enum _:qState { AddOne, AddTwo }

new g_System = NONE;
new Handle:g_DBTuple;
new g_TableAdmins[100], g_TableSAdmins[100], g_TableSInfo[100], g_ServerIp[25];
new g_szQuery[1024], g_Data[2];

public plugin_init()
{
#define PNAME "AES Bonus: Flags"
#define PVERSION "0.2"
#define PAUTHOR "Sonyx"
register_plugin(PNAME, PVERSION, PAUTHOR);
}

public amxbans_sql_initialized(Handle:sqlTuple, const dbPrefix[])
{
if (g_System != NONE) {
return PLUGIN_CONTINUE;
}

g_DBTuple = sqlTuple;
g_System = AMX;

formatex(g_TableAdmins, charsmax(g_TableAdmins), "%s_amxadmins", dbPrefix);
formatex(g_TableSInfo, charsmax(g_TableSInfo), "%s_serverinfo", dbPrefix);
formatex(g_TableSAdmins, charsmax(g_TableSAdmins), "%s_admins_servers", dbPrefix);

get_cvar_string("amxbans_server_address", g_ServerIp, charsmax(g_ServerIp));
if (!g_ServerIp[0]) {
get_user_ip(0, g_ServerIp, charsmax(g_ServerIp), 0);
}

return PLUGIN_CONTINUE;
}

public lite_bans_sql_init(Handle:sqlTuple)
{
new dbPrefix[64];

if (g_System != NONE) {
return PLUGIN_CONTINUE;
}

g_DBTuple = sqlTuple;
g_System = LB;

get_cvar_string("lb_sql_pref", dbPrefix, charsmax(dbPrefix));

formatex(g_TableAdmins, charsmax(g_TableAdmins), "%s_amxadmins", dbPrefix);
formatex(g_TableSInfo, charsmax(g_TableSInfo), "%s_serverinfo", dbPrefix);
formatex(g_TableSAdmins, charsmax(g_TableSAdmins), "%s_admins_servers", dbPrefix);

get_cvar_string("lb_server_ip", g_ServerIp, charsmax(g_ServerIp));
if (!g_ServerIp[0]) {
get_user_ip(0, g_ServerIp, charsmax(g_ServerIp), 0);
}

return PLUGIN_CONTINUE;
}

public fbans_sql_connected(Handle:sqlTuple)
{
new i_Ip[16], i_Port[8];
if (g_System != NONE) {
return PLUGIN_CONTINUE;
}

g_DBTuple = sqlTuple;
g_System = FB;
if (!get_cvar_string("amx_amxadmins_table", g_TableAdmins, charsmax(g_TableAdmins)))
g_TableAdmins = "amx_amxadmins";
if (!get_cvar_string("amx_admins_table", g_TableSAdmins, charsmax(g_TableSAdmins)))
g_TableSAdmins = "amx_admins_servers";
get_cvar_string("fb_servers_table", g_TableSInfo, charsmax(g_TableSInfo));
get_cvar_string("fb_server_ip", i_Ip, charsmax(i_Ip));
get_cvar_string("fb_server_port", i_Port, charsmax(i_Port));

formatex(g_ServerIp, charsmax(g_ServerIp), "%s:%s", i_Ip, i_Port);

return PLUGIN_CONTINUE;
}

public SQL_Handler(failstate, Handle:query, err[], errcode, dt[], datasize)
{
switch(failstate)
{
case TQUERY_CONNECT_FAILED, TQUERY_QUERY_FAILED:
{
log_amx("[SQL ERROR #%d][Query State %d] %s", errcode, dt[0], err);
SQL_FreeHandle(query);
return;
}
}

switch(dt[0])
{
case AddOne:
{
g_Data[0] = AddTwo;
new szAuth[25], iID = SQL_GetInsertId(query);
get_user_authid(dt[1], szAuth, charsmax(szAuth));
formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO %s (admin_id, server_id, custom_flags, use_static_bantime) VALUES ('%d', (SELECT id FROM %s WHERE address = '%s'), '', 'no')", g_TableSAdmins, iID, g_TableSInfo, g_ServerIp);
SQL_ThreadQuery(g_DBTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}
case AddTwo:
{
SQL_FreeHandle(query);
server_cmd("amx_reloadadmins");
}
}
}

public pointBonus_GiveFlags(id, flags[], days)
{
if(!flags[0] || !days)
return 0;
if (g_System == NONE)
{
client_print_color(id, id, "^4[GvsD] ^3There is no connection to the base!");
return 0;
}
if (get_user_flags(id) & read_flags(flags))
{
client_print_color(id, id, "^4[GvsD] ^3You already have this privilege!");
return 0;
}
new szAuth[25], szName[32], szPlayerEnd;

get_user_authid(id, szAuth, charsmax(szAuth));
get_user_name(id, szName, charsmax(szName));
szPlayerEnd = get_systime() + days * 86400;

g_Data[0] = AddOne;
g_Data[1] = id;

formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO %s (username, access, flags, steamid, nickname, ashow, created, expired, days) VALUES ('%s', '%s', 'ce', '%s', '%s', '0', UNIX_TIMESTAMP(NOW()), '%d', '%d')", g_TableAdmins, szAuth, flags, szAuth, szName, szPlayerEnd, days);
SQL_ThreadQuery(g_DBTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));

return 1;
}
Plugin acts like it works.
When player buys via /shop (/anew) command flag, he doesn't receive it, but he receives information and his points are spent.
I have checked SQL and I have FBBans. Bans are recorded just fine in SQL. I have two servers connected via same SQL (sharing banlist).
In SQL I have table amx_admins_servers:
1671050477098.png

but it is empty.

What am I doing wrong?
edit: All tables requested by plugin exist in my sql. *

edit2: Plugin was not turned on. I did not receive errors in logs, but in chat I found it ...
Now I have all data in SQL but it's not loaded.

Should some parameter has to be changed in FBBans cfg (my admins are from users.ini, not from sql)
 
Последнее редактирование:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу