Плагин CSBANS Tools [FB ONLY] 0.0.2

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
103
Реакции
4
Ошибка
unknown unknown unknown csbans_tools.amxx bad load
Load fails: Module/Library "freshbans_core" required for plugin. Check modules.ini.
ОС
Linux
Amx Mod X
1.9.0
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.767-dev
Build date: 03:13:55 Oct 25 2021 (2753)
Build from: https://github.com/dreamstalker/rehlds/commit/471158b
ReGamedll
ReGameDLL version: 5.21.0.540-dev
Build date: 17:33:16 Oct 25 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/b9cccc6
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
[ 1] SafeNameAndChat       RUN   -    SafeNameAndChat.so          v1.2 Beta 3      ini  ANY   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 3] Revoice RUN - revoice_plus_mm.so v1.0.3 ini ANY Never
[ 4] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 5] SoftBlocker RUN - softblocker_mm_i386.so v1.1g ini ANY Never
[ 6] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 8] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 9] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[10] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5 ini Chlvl Chlvl
[11] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.0.10 ini Start ANY
[12] VoiceUtils RUN - voice_utils_amxx_i386.so v1.0.0 pl8 ANY ANY
[13] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[15] Admins Kit RUN - adminskit_amxx_i386.so v2.0.0 pl8 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[17] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl8 ANY ANY
[18] Hide Cvars RUN - hidecvars_amxx_i386.so v1.0 pl8 ANY ANY
[19] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl8 ANY Never
[20] ReAPI RUN - reapi_amxx_i386.so v5.21.0.248-dev pl8 ANY Never
[21] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[22] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[23] CURL AMXX RUN - curl_amxx_i386.so v1.1.1 pl8 ANY ANY
[24] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[25] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
[26] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl8 ANY ANY
26 plugins, 26 running
Список плагинов
[  1] Admin Loader            3.5         neygomon          admin_loader.am  running  
[ 2] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 3] Stop the Bastards 1.7.0 F@nt0M stop_the_bastar running
[ 4] Bypass Guard 1.0.1 mx?! bypass_guard.am running
[ 5] [BG] Provider: GeoIP 0.2 mx?! bg_provider_geo running
[ 6] [BG] Provider: iphub.i 0.5-curl mx?! bg_provider_iph running
[ 7] Anticheat 3.1.6 ctr52 anticheat.amxx running
[ 8] Anti Sound ESP 0.2.181 s3zy AntiSoundESP.am running
[ 9] BhopHack Detector 0.1 Mistrick bhophack_detect running
[ 10] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 11] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 12] Advanced Client Checke 0.3.7 Mistrick cmdchecker.amxx running
[ 13] ReChecker Logging 1.0 custom rc_logging.amxx running
[ 14] [190] MOTD RBS 21.03.23 SKAJIbnEJIb motd_rbs.amxx running
[ 15] Night Mode 1.2.3 Radius night_mode.amxx running
[ 16] Auto VIP [STEAM] 1.1 ArtHa auto_steam_vip. running
[ 17] [190] Top Award RBS 20.06.06 SKAJIbnEJIb topaward_rbs.am running
[ 18] SUPERVIP-TOP 8 1.3.2 uMk0 topkiller.amxx running
[ 19] [190] AdminChat RBS 20.06.06 SKAJIbnEJIb adminchat_rbs.a running
[ 20] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 21] [190] Cvar On Map 20.06.06 SKAJIbnEJIb cvar_on_map.amx running
[ 22] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 23] Weapon Model + Sound R 1.2 GHW_Chronic GHW_Weapon_Repl running
[ 24] [190] Ultimate Weapons 21.03.23 SKAJIbnEJIb ultimate_weapon running
[ 25] [190] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 26] [190] CsStats MySQL 20.06.06 SKAJIbnEJIb csstats_mysql.a running
[ 27] [190] CsStats Editor 20.06.06 SKAJIbnEJIb csstats_editor. running
[ 28] [190] Skill ELO 20.06.06 SKAJIbnEJIb skill_elo.amxx running
[ 29] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 30] Stats Configuration 1.8.2 AMXX Dev Team statscfg.amxx running
[ 31] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 32] [190] AdminCmd RBS 20.06.06 SKAJIbnEJIb & AM admincmd_rbs.am running
[ 33] Defused Sound 1.0 MayroN | Stimul Bomb_Defused_So running
[ 34] Ultimate Chats Control 5.2(c) neygomon ucc.amxx running
[ 35] unknown unknown unknown ucc_api_example running
[ 36] UCC Addon: VoteGAG 1.2 neygomon ucc_votegag.amx running
[ 37] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 38] Damager 0.0.6 steelzzz damager.amxx running
[ 39] [190] No Team Flash 20.06.06 SKAJIbnEJIb NoTeamFlash.amx running
[ 40] Rock to Ban 2.26ff Safety1st rock2ban.amxx running
[ 41] [190] RestMenu RBS 20.06.06 SKAJIbnEJIb & AM restmenu_rbs.am running
[ 42] Map Manager: Effects 0.0.9 Mistrick map_manager_eff running
[ 43] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 44] Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
[ 45] [190] Chat RBS 20.06.06 SKAJIbnEJIb chat_rbs.amxx running
[ 46] [190] MapsMenu RBS 20.06.06 SKAJIbnEJIb & AM mapsmenu_rbs.am running
[ 47] [190] Parachute RBS 20.06.06 SKAJIbnEJIb & KR parachute_rbs.a running
[ 48] DHUD Deads ALL 1.3.1 M1 TEAM dhud_message_de running
[ 49] [ReAPI] KiLL Assist poka_4to_b PRoSToTeM@ Kill_assist_rea running
[ 50] [Reapi] Custom Models 1.6.1 neygomon custom_models.a running
[ 51] Reset Score 1.0 M1 TEAM ResetScore.amxx running
[ 52] Money 1.1 M1 TEAM money.amxx running
[ 53] Advert Messages 1.22 neygomon adverts.amxx running
[ 54] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 55] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 56] HS Sound 1.0 M1 TEAM headshot.amxx running
[ 57] [ReAPI] Mode 2x2 2.5re M1 TEAM mode.amxx running
[ 58] [190] AR Bets 20.06.06 SKAJIbnEJIb ar_bets.amxx running
[ 59] [190] SlayLosers RBS 20.06.06 SKAJIbnEJIb & d3 slaylosers_rbs. running
[ 60] DemoRecoder 1.1 neygomon amx_demorec.amx running
[ 61] Nice Killer 1.6 Got Milk? / HoHo nice_killer.amx running
[ 62] [190] Block Reconnect 20.06.06 ShaTalKiN Block_Reconnect running
[ 63] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 64] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 65] unknown unknown unknown vote.amxx running
[ 66] Color Flash Screen 1.6.4 Radius (Stimul i color_flash_scr running
[ 67] fb_forwards 0.1.5 Kanagava & Realu fb_forwards.amx running
[ 68] Real Nade Drops 0.4 VEN realnadedrops.a running
[ 69] [190] First Players Re 20.06.06 SKAJIbnEJIb FirstPlayersRes running
[ 70] [ReAPI] Healthnade 0.0.487 (m F@nt0M reapi_healthnad running
[ 71] [190] Snipers RBS 20.06.06 SKAJIbnEJIb snipers_rbs.amx running
[ 72] Mute 1.0 Makenzo mute.amxx running
[ 73] Spec Money Save 0.2 F@nt0M spec_money_save running
[ 74] BOMB REAL TIMER 4.5 Vaqtincha | Flym bomb_real_timer running
[ 75] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 76] CT Bomb Cracker 0.5 Vaqtincha ct_bomb_cracker running
[ 77] Lucky Defuser 1.0 iPlague lucky_defuser.a running
[ 78] Lie Flat Optimized 1.1 Nomexous lie_flat_optimi running
[ 79] Gore lite 0.1 Vaqtincha gorelite.amxx running
[ 80] [190] Analizator 20.06.06 SKAJIbnEJIb analizator.amxx running
[ 81] Map Manager: Core 3.0.7 Mistrick map_manager_cor running
[ 82] Map Manager: Scheduler 0.1.5 Mistrick map_manager_sch running
[ 83] Map Manager: Nominatio 0.1.2 Mistrick map_manager_nom running
[ 84] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
84 plugins, 84 running
Автор плагина
uMk0
Версия плагина
0.0.2
Исходный код
#include <amxmodx>
#include <sqlx>
#include <freshbans>
#define PLUGIN "[FB] CSBANS Tools"
#define VERSION "0.0.2"
#define AUTHOR "uMk0"
#define ACCESS_FLAG ADMIN_RCON //Флаг доступа в меню

enum _:UserInfo {
Auth[MAX_NAME_LENGTH],
Access[23],
Expired,
NameGroups[32],
id_groups,
id_db
}
enum _:menuStatus {
MENU_CURRENT,
MENU_EDITID
}
enum _:menuCurrent {
MID_LIST,
MID_INFO,
MID_GROUPS,
MID_DAYS
}
enum _:ServerData { IP[24] }
enum _:SqlData { ServerInfo[32], Prefix[10] }
enum _:sql_que_type{
SQL_GET_SERVER_ID,
SQL_GET_PLAYERS,
SQL_SET_PLAYER,
SQL_UPDATE_PLAYER,
SQL_REMOVE_PLAYER
}
enum (+=1) {
SectionNone = -1,
Days,
Groups
};
enum _:groups {
Name[32],
Access[23]
}
enum _:days {
Day
}
new const CONFIG_NAME[] = "csbans_tools.ini";
new g_idServer,
g_szServerData[ServerData],
g_szSqlData[SqlData],
g_Data[6],
g_szQuery[512],
Handle:g_hSqlTuple,
Array:g_aUsers,
g_sUser[UserInfo],
g_Section,
g_Groups[128][groups],
g_Days[128][days],
i_groups = 0,
i_days = 0,
g_MenuStatus[33][menuStatus];
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("csbans_menu","CreateMenuPlayer",ACCESS_FLAG,"- open CSBANS menu");
register_dictionary("csbans_tools.txt");
g_aUsers = ArrayCreate(UserInfo);
new filedir[MAX_RESOURCE_PATH_LENGTH];
get_localinfo("amxx_configsdir", filedir, charsmax(filedir));
format(filedir, charsmax(filedir), "%s/%s", filedir, CONFIG_NAME);
if(!file_exists(filedir)) {
set_fail_state("File '%s' not found!", filedir);
pause("a");
}
if(!parseConfigINI(filedir)) {
set_fail_state("Fatal parse error!");
pause("a");
}
}
public fbans_sql_connected(const Handle: db){
g_hSqlTuple = db;
LoadCvar();
}
public LoadCvar(){
new ip[16]; get_cvar_string("fb_server_ip", ip, charsmax(ip));
new port[8]; get_cvar_string("fb_server_port", port, charsmax(port));
formatex(g_szServerData[IP], charsmax(g_szServerData[IP]), "%s:%s", ip, port);
get_cvar_string("fb_servers_table", g_szSqlData[ServerInfo], charsmax(g_szSqlData[ServerInfo]));
strtok(g_szSqlData[ServerInfo], g_szSqlData[Prefix], charsmax(g_szSqlData[Prefix]), "", 0, '_');

GetServerId();
}
public GetServerId(){
g_Data[0] = SQL_GET_SERVER_ID;
formatex(g_szQuery, charsmax(g_szQuery), "SELECT `id` FROM `%s` WHERE `address` = '%s'",
g_szSqlData[ServerInfo], g_szServerData[IP]
);
SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}
public LoadAdminSQL(openMenu,id,player){
g_Data[0] = SQL_GET_PLAYERS;
g_Data[1] = openMenu;
g_Data[2] = id;
g_Data[3] = player;
formatex(g_szQuery, charsmax(g_szQuery), "SELECT \
`a`.`id`, \
`a`.`steamid`, \
`a`.`password`, \
`a`.`nickname`, \
`a`.`access`, \
`a`.`flags`, \
`a`.`expired`, \
`b`.`custom_flags` \
FROM `%s_amxadmins` AS `a`, `%s_admins_servers` AS `b` \
WHERE `b`.`admin_id` = `a`.`id` \
AND `b`.`server_id` = %d \
AND (`a`.`id` > 0)",
g_szSqlData[Prefix], g_szSqlData[Prefix], g_idServer);
SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}

public SQL_Handler(failstate, Handle:query, err[], errcode, dt[], datasize){
switch(failstate){
case TQUERY_CONNECT_FAILED, TQUERY_QUERY_FAILED:{
log_amx("[Проблемы с БД. Код ошибки: #%d] Ошибка: %s", errcode, err);
return;
}
}
switch(dt[0]){
case SQL_GET_SERVER_ID: {
g_idServer = SQL_ReadResult(query, 0);
LoadAdminSQL(0,0,0);
}
case SQL_GET_PLAYERS: {
ArrayClear(g_aUsers);
if(!SQL_NumResults(query)){
log_amx("Администраторы для сервера %s не найдены в БД!", g_szServerData[IP]);
return;
}
while(SQL_MoreResults(query)){
g_sUser[id_db] = SQL_ReadResult(query, 0);
SQL_ReadResult(query, 1, g_sUser[Auth], charsmax(g_sUser[Auth]));
SQL_ReadResult(query, 4, g_sUser[Access], charsmax(g_sUser[Access]));
g_sUser[Expired] = SQL_ReadResult(query, 6);
ArrayPushArray(g_aUsers, g_sUser);
SQL_NextRow(query);
}
if(dt[1] != 0){
if(get_user_flags(dt[2]) & ACCESS_FLAG){
CreateMenuInfo(dt[2],dt[3]);
}
server_cmd("amx_reloadadmins");
}
}
case SQL_SET_PLAYER: {
new adminName[32];
get_user_name(dt[2],adminName,charsmax(adminName));
switch((g_Days[dt[4]][Day] % 10)){
case 1: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_SET_APPOINTED", adminName, g_Groups[dt[3]][Name],g_Days[dt[4]][Day],dt[1],"CSBANS_DAY_CHAT");
}
case 2,3,4: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_SET_APPOINTED", adminName, g_Groups[dt[3]][Name],g_Days[dt[4]][Day],dt[1],"CSBANS_DAY_234_CHAT");
}
default: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_SET_APPOINTED", adminName, g_Groups[dt[3]][Name],g_Days[dt[4]][Day],dt[1],"CSBANS_DAY_N_CHAT");
}
}
LoadAdminSQL(1,dt[2],dt[1]);
}
case SQL_UPDATE_PLAYER: {
new adminName[32];
get_user_name(dt[2],adminName,charsmax(adminName));
switch((g_Days[dt[3]][Day] % 10)){
case 1: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_UPDATE_APPOINTED", adminName, g_Days[dt[3]][Day],dt[1],"CSBANS_DAY_CHAT");
}
case 2,3,4: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_UPDATE_APPOINTED", adminName, g_Days[dt[3]][Day],dt[1],"CSBANS_DAY_234_CHAT");
}
default: {
client_print_color(dt[1],print_team_default,"%L %L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_UPDATE_APPOINTED", adminName, g_Days[dt[3]][Day],dt[1],"CSBANS_DAY_N_CHAT");
}
}
LoadAdminSQL(1,dt[2],dt[1]);
}
case SQL_REMOVE_PLAYER: {
new adminName[32];
get_user_name(dt[2],adminName,charsmax(adminName));
client_print_color(dt[1],print_team_default,"%L %L",dt[1],"CSBANS_TAG_CHAT",dt[1],"CSBANS_CHAT_REMOVE",adminName);
LoadAdminSQL(1,dt[2],dt[1]);
}
}
}
public CreateMenuPlayer(id){
if(!(get_user_flags(id) & ACCESS_FLAG)){
client_print_color(id,print_team_default,"%L %L",id,"CSBANS_TAG_CHAT",id,"CSBANS_NOT_ACCESS");
client_print(id,print_console,"[CSBANS] %L",id,"CSBANS_NOT_ACCESS");
return;
}
g_MenuStatus[id][MENU_CURRENT] = MID_LIST;
new langStr[96];
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_PLAYERS");
new menu = menu_create(langStr,"HandlerMenu");
new players[MAX_PLAYERS],pCount;
new name[MAX_NAME_LENGTH],lKey[10];
get_players(players,pCount);
for(new i ; i < pCount ; ++i){
if(is_user_hltv(id) || is_user_bot(id) || !is_user_connected(id)){
continue;
}
get_user_name(players[i],name,charsmax(name));

formatex(langStr,charsmax(langStr),"%s",name);

formatex(lKey,charsmax(lKey),"f%d",players[i]);
menu_additem(menu,langStr,lKey);
}
NavButtons(id,menu);
menu_display(id,menu);
return;
}
public CreateMenuInfo(id,player){

if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
if(!(get_user_flags(id) & ACCESS_FLAG)){
client_print_color(id,print_team_default,"%L %L",id,"CSBANS_TAG_CHAT",id,"CSBANS_NOT_ACCESS");
client_print(id,print_console,"[CSBANS] %L",id,"CSBANS_NOT_ACCESS");
return;
}
g_MenuStatus[id][MENU_CURRENT] = MID_INFO;
g_MenuStatus[id][MENU_EDITID] = player;
new langStr[128],name[32],lKey[10];
get_user_name(player,name,charsmax(name));


new arr_lUser[UserInfo];
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO",name);
new menu = menu_create(langStr,"HandlerMenu")

if(getUserArray(player,arr_lUser)){
if(arr_lUser[Expired] != 0){
formatex(lKey,charsmax(lKey),"u%d",player);
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_UPDATE");
menu_additem(menu,langStr,lKey);
}
formatex(lKey,charsmax(lKey),"d%d",player);
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_DROP");
menu_additem(menu,langStr,lKey);

if(arr_lUser[id_groups] == -1){
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_YES","Не известно");
menu_addtext(menu,langStr)
}else{
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_YES",arr_lUser[NameGroups]);
menu_addtext(menu,langStr)
}
if(arr_lUser[Expired] == 0){
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_YES_DATE","Никогда");
menu_addtext(menu,langStr)
}else{
new Date[32];
format_time(Date,charsmax(Date), "%d.%m.%Y",arr_lUser[Expired])
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_YES_DATE",Date);
menu_addtext(menu,langStr)
new day = (arr_lUser[Expired]-get_systime())/86400;
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_YES_EXPIRE_DAYS",day);
menu_addtext(menu,langStr)
}
}else{
formatex(lKey,charsmax(lKey),"a%d",player);
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_ADD");
menu_additem(menu,langStr,lKey);
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_INFO_NO");
menu_addtext(menu,langStr)
}

NavButtons(id,menu);
menu_display(id,menu);
return;
}
public CreateMenuGroups(id,player,id_day){
if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
if(!(get_user_flags(id) & ACCESS_FLAG)){
client_print_color(id,print_team_default,"%L %L",id,"CSBANS_TAG_CHAT",id,"CSBANS_NOT_ACCESS");
client_print(id,print_console,"[CSBANS] %L",id,"CSBANS_NOT_ACCESS");
return;
}
g_MenuStatus[id][MENU_CURRENT] = MID_GROUPS;
g_MenuStatus[id][MENU_EDITID] = player;
new langStr[128],name[32],lKey[10];
get_user_name(player,name,charsmax(name));
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_GROUPS",name);
new menu = menu_create(langStr,"HandlerMenu");
formatex(langStr,charsmax(langStr),"%L%L",id,"CSBANS_TITLE_GROUPS_DAY",g_Days[id_day][Day],id,"CSBANS_TITLE_GROUPS_SUB");
formatex(lKey,charsmax(lKey),"D%d:%d",player,id_day);
menu_additem(menu,langStr,lKey);
for(new i; i < i_groups; i++){
formatex(langStr,charsmax(langStr),"%s",g_Groups[i][Name]);
formatex(lKey,charsmax(lKey),"s%d|%d:%d",i,player,id_day);
menu_additem(menu,langStr,lKey);
}
NavButtons(id,menu);
menu_display(id,menu);
return;
}
public CreateMenuDays(id,player){
if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
if(!(get_user_flags(id) & ACCESS_FLAG)){
client_print_color(id,print_team_default,"%L %L",id,"CSBANS_TAG_CHAT",id,"CSBANS_NOT_ACCESS");
client_print(id,print_console,"[CSBANS] %L",id,"CSBANS_NOT_ACCESS");
return;
}
g_MenuStatus[id][MENU_CURRENT] = MID_DAYS;
g_MenuStatus[id][MENU_EDITID] = player;
new langStr[128],name[32],lKey[10];
get_user_name(player,name,charsmax(name));
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_TITLE_DAYS",name);
new menu = menu_create(langStr,"HandlerMenu");
for(new i; i < i_days; i++){
switch((g_Days[i][Day] % 10)){
case 1: {
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_DAY",g_Days[i][Day]);
formatex(lKey,charsmax(lKey),"U%d:%d",player,i);
}
case 2,3,4: {
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_DAY_234",g_Days[i][Day]);
formatex(lKey,charsmax(lKey),"U%d:%d",player,i);
}
default: {
formatex(langStr,charsmax(langStr),"%L",id,"CSBANS_DAY_N",g_Days[i][Day]);
formatex(lKey,charsmax(lKey),"U%d:%d",player,i);
}
}
menu_additem(menu,langStr,lKey);
}
NavButtons(id,menu);
menu_display(id,menu);
return;
}
public HandlerMenu(id,menu,item){
if(item == MENU_EXIT){
menu_destroy(menu);
switch(g_MenuStatus[id][MENU_CURRENT]){
case MID_INFO: CreateMenuPlayer(id);
case MID_GROUPS,MID_DAYS: CreateMenuInfo(id,g_MenuStatus[id][MENU_EDITID]);
}
return;
}
new itemData[20];
new a,n[2];
menu_item_getinfo(menu,item,a,itemData,19,n,1,a);
switch(itemData[0]){
case 'f':{
CreateMenuInfo(id,str_to_num(itemData[1]));
}
case 'a':{
if(!is_user_connected(str_to_num(itemData[1]))){
CreateMenuPlayer(id);
return;
}
CreateMenuGroups(id,str_to_num(itemData[1]),0);
}
case 'D':{

new tmp1[32],tmp2[32],tmp3[32],player,id_day;
strtok(itemData, tmp1, charsmax(tmp1), tmp2, charsmax(tmp2), 'D');strtok(tmp2, tmp2, charsmax(tmp2), tmp3, charsmax(tmp3), ':');
player = str_to_num(tmp2);
id_day = str_to_num(tmp3);
if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
id_day++;
if(i_days == id_day)
id_day = 0;
CreateMenuGroups(id,player,id_day);
}
case 's':{
new tmp1[32],tmp2[32],tmp3[32],tmp4[32],id_group,player,id_day,name[32],authid[64];
strtok(itemData, tmp1, charsmax(tmp1), tmp2, charsmax(tmp2), 's');strtok(tmp2, tmp2, charsmax(tmp2), tmp3, charsmax(tmp3), '|');strtok(tmp3, tmp3, charsmax(tmp3), tmp4, charsmax(tmp4), ':');
id_group = str_to_num(tmp2);
player = str_to_num(tmp3);
id_day = str_to_num(tmp4);
if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
get_user_name(player,name,charsmax(name));
mysql_escape_string_tk(name,charsmax(name));
get_user_authid(player,authid,charsmax(authid));
g_Data[0] = SQL_SET_PLAYER;
g_Data[1] = player;
g_Data[2] = id;
g_Data[3] = id_group;
g_Data[4] = id_day;
formatex(g_szQuery, charsmax(g_szQuery), "INSERT INTO `%s_amxadmins` (`id`, `username`, `password`, `access`, `flags`, `steamid`, `nickname`, `icq`, `ashow`, `created`, `expired`, `days`) VALUES (NULL, '%s', NULL, '%s', 'ce', '%s', '%s', NULL, '0', '%d', '%d', '%d');INSERT INTO `%s_admins_servers` (`admin_id`, `server_id`, `custom_flags`, `use_static_bantime`) VALUES ((SELECT MAX(id) FROM `%s_amxadmins`), '%d', '', 'no');",
g_szSqlData[Prefix], authid,g_Groups[id_group][Access],authid,name,get_systime(),get_systime()+(g_Days[id_day][Day]*86400),g_Days[id_day][Day],g_szSqlData[Prefix],g_szSqlData[Prefix],g_idServer);
SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}
case 'u': {
if(!is_user_connected(str_to_num(itemData[1]))){
CreateMenuPlayer(id);
return;
}
CreateMenuDays(id,str_to_num(itemData[1]));
}
case 'U': {

new tmp1[32],tmp2[32],tmp3[32],player,id_day;
strtok(itemData, tmp1, charsmax(tmp1), tmp2, charsmax(tmp2), 'U');strtok(tmp2, tmp2, charsmax(tmp2), tmp3, charsmax(tmp3), ':');
player = str_to_num(tmp2);
id_day = str_to_num(tmp3);
if(!is_user_connected(player)){
CreateMenuPlayer(id);
return;
}
new arr_lUser[UserInfo];
getUserArray(player,arr_lUser);
if(arr_lUser[Expired] < get_systime()){
formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s_amxadmins` SET `expired` = '%d', `days` = '%d' WHERE `id` = %d;",
g_szSqlData[Prefix], get_systime()+(g_Days[id_day][Day]*86400),g_Days[id_day][Day],arr_lUser[id_db]);
}else{

formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `%s_amxadmins` SET `expired` = `expired` + %d, `days` = `days` + %d WHERE `id` = %d;",
g_szSqlData[Prefix], (g_Days[id_day][Day]*86400),g_Days[id_day][Day],arr_lUser[id_db]);
}
g_Data[0] = SQL_UPDATE_PLAYER;
g_Data[1] = player;
g_Data[2] = id;
g_Data[3] = id_day;
SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}
case 'd': {
if(!is_user_connected(str_to_num(itemData[1]))){
CreateMenuPlayer(id);
return;
}
new arr_lUser[UserInfo];
getUserArray(str_to_num(itemData[1]),arr_lUser);
g_Data[0] = SQL_REMOVE_PLAYER;
g_Data[1] = str_to_num(itemData[1]);
g_Data[2] = id;
formatex(g_szQuery, charsmax(g_szQuery), "DELETE FROM `%s_amxadmins` WHERE `id` = %d; DELETE FROM `%s_admins_servers` WHERE `admin_id` = %d AND `server_id` = %d",
g_szSqlData[Prefix], arr_lUser[id_db], g_szSqlData[Prefix], arr_lUser[id_db], g_idServer);
SQL_ThreadQuery(g_hSqlTuple, "SQL_Handler", g_szQuery, g_Data, sizeof(g_Data));
}
}
return;
}
public NavButtons(id,menu){
new tmpLang[20];

formatex(tmpLang,charsmax(tmpLang),"%L",id,"BACK");
menu_setprop(menu,MPROP_BACKNAME,tmpLang);

formatex(tmpLang,charsmax(tmpLang),"%L",id,"EXIT");
menu_setprop(menu,MPROP_EXITNAME,tmpLang);

formatex(tmpLang,charsmax(tmpLang),"%L",id,"MORE");
menu_setprop(menu,MPROP_NEXTNAME,tmpLang);
}
bool:parseConfigINI(const configFile[]) {
new INIParser:parser = INI_CreateParser();
if(parser != Invalid_INIParser) {
INI_SetReaders(parser, "ReadCFGKeyValue", "ReadCFGNewSection");
INI_ParseFile(parser, configFile);
INI_DestroyParser(parser);
return true;
}
return false;
}
public bool:ReadCFGNewSection(INIParser:handle, const section[], bool:invalid_tokens, bool:close_bracket) {
if(!close_bracket) {
log_amx("Closing bracket was not detected! Current section name '%s'.", section);
return false;
}
if(equal(section, "days")) {
g_Section = Days;
return true;
}

if(equal(section, "groups")) {
g_Section = Groups;
return true;
}
return false;
}
public bool:ReadCFGKeyValue(INIParser:handle, const key[], const value[]) {
switch(g_Section) {
case SectionNone: {
return false;
}
case Days: {
g_Days[i_days][Day] = str_to_num(key);
i_days++;
}
case Groups: {
if(!key[0] || !value[0]) {
log_amx("Emty key or value!");
return false;
}
formatex(g_Groups[i_groups][Name],charsmax(g_Groups[][Name]),"%s",key);
formatex(g_Groups[i_groups][Access],charsmax(g_Groups[][Access]),"%s",value);
i_groups++;
}
}
return true;
}
stock mysql_escape_string_tk(dest[],len){
replace_all(dest,len,"\\","\\\\");
replace_all(dest,len,"\0","\\0");
replace_all(dest,len,"\n","\\n");
replace_all(dest,len,"\r","\\r");
replace_all(dest,len,"\x1a","\Z");
replace_all(dest,len,"'","''");
replace_all(dest,len,"^"","^"^"");
}
stock getUserArray(id, array[UserInfo]){
if(!is_user_connected(id)){
return false;
}
new authid[64];
get_user_authid(id,authid,charsmax(authid))
for(new i, aSize = ArraySize(g_aUsers); i < aSize; i++){
ArrayGetArray(g_aUsers, i, g_sUser);
if(equal(g_sUser[Auth],authid)){
array[id_groups] = -1;
for(new k; k < i_groups; k++){
if(equal(g_Groups[k][Access],g_sUser[Access])){
array[id_groups] = k;
formatex(array[NameGroups],charsmax(array[NameGroups]),"%s",g_Groups[k][Name]);
break;
}
}
formatex(array[Access],charsmax(array[Access]),"%s",g_sUser[Access]);
formatex(array[Auth],charsmax(array[Auth]),"%s",g_sUser[Auth]);
array[Expired] = g_sUser[Expired];
array[id_db] = g_sUser[id_db]
return true;
}
}
return false;
}
плагин не включается :(
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
3,582
Реакции
1,570
Помог
137 раз(а)
Lady, попробуй обновить FB до последней версии.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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