Проблема с работой Ultimate Chats Control

Сообщения
68
Реакции
8
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Ошибка
amx_gagmenu
Unknown command: amx_gagmenu
ОС
Linux
Билд
Protocol version 48 
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.633-dev
Build date: 10:34:06 Jan 24 2018 (1383)
Build from: https://github.com/dreamstalker/rehlds/commit/82ee1b0
ReGamedll
ReGameDLL version: 5.7.0.295-dev 
Build date: 15:10:22 Feb 19 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/aa329db
Список метамодулей
Currently loaded plugins: 
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.8.3-Re ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.89 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 8] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 9] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.5.0.150-dev pl1 ANY Never
[11] MySQL RUN - mysql_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[12] CSX Extended RUN - csx_amxx_i386.so v1.5 pl1 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[14] Fun RUN - fun_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[16] Engine RUN - engine_amxx_i386.so v1.8.3-Re pl1 ANY ANY
[17] CStrike RUN - cstrike_amxx_i386.so v1.8.3-Re pl1 ANY ANY
17 plugins, 17 running
Список плагинов
L 03/15/2018 - 17:37:42: [aes_bonus_system.amxx] [ERROR] can't find function "roundBonus_GiveHP" on line 168 
[ReAuthCheck] Success: Configuration executed.
[ReSRDetector] Success: Configuration executed.
Бегущая строка заблокирована
Can't precache resource with absolute path :
Can't precache resource with absolute path :
L 03/15/2018 - 17:37:43: Started map "de_dust2_2x2" (CRC "1607683513")
L 03/15/2018 - 17:37:43: [pluginmenu.amxx] Function not found! (AddMenuItem_call failed)
L 03/15/2018 - 17:37:43: [pluginmenu.amxx] Function not found! (AddMenuItem_call failed)
L 03/15/2018 - 17:37:43: Server cvar "mp_autoteambalance" = "0"
L 03/15/2018 - 17:37:43: [admin.amxx] Login: "sT | Вячеслав<1><STEAM_0:0:209346190><>" became an admin (account "STEAM_0:0:209346190") (access "abcdefghijklmnopqrtu") (address "185.197.181.160")
L 03/15/2018 - 17:37:46: World triggered "Round_Start"
L 03/15/2018 - 17:37:48: "sT | Вячеслав<1><STEAM_0:0:209346190><>" entered the game
L 03/15/2018 - 17:37:48: [VTC] Client sT | Вячеслав with new codec connected
L 03/15/2018 - 17:37:50: "sT | Вячеслав<1><STEAM_0:0:209346190><>" joined team "CT"
L 03/15/2018 - 17:38:46: "sT | Вячеслав<1><STEAM_0:0:209346190><CT>" committed suicide with "world"
L 03/15/2018 - 17:38:46: World triggered "Round_Draw" (CT "0") (T "0")
L 03/15/2018 - 17:38:46: World triggered "Round_End"
L 03/15/2018 - 17:38:46: "sT | Вячеслав<1><STEAM_0:0:209346190><CT>" joined team "SPECTATOR"
L 03/15/2018 - 17:38:53: World triggered "Round_Start"
amx_plugins
Currently loaded plugins:
name version author file status
[ 1] Lite Bans 1.5 neygomon lite_bans_183.a debug
[ 2] RC BaseChanger freesrv AMXX rc_basechanger. debug
[ 3] ReChecker Logging freesrv AMXX rc_logging.amxx debug
[ 4] Ultimate Chats Control 3.3 neygomon ucc.amxx debug
[ 5] UCC Addon: VoteGAG 1.2 neygomon ucc_votegag.amx debug
[ 6] Admin Base 1.8.3-Re AMXX Dev Team admin.amxx debug
[ 7] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx debug
[ 8] Multi-Lingual System 1.8.3-Re AMXX Dev Team multilingual.am debug
[ 9] Menus Front-End 1.5 neugomon menufront_end.a debug
[ 10] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx debug
[ 11] Players Menu 1.7 neugomon players_menu.am debug
[ 12] Maps Menu 1.4.1 neugomon mapsmenu.amxx debug
[ 13] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx debug
[ 14] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx debug
[ 15] Anti Flood 1.8.3-Re AMXX Dev Team antiflood.amxx debug
[ 16] Scrolling Message 1.8.3-Re AMXX Dev Team scrollmsg.amxx debug
[ 17] Info. Messages 1.8.3-Re AMXX Dev Team imessage.amxx debug
[ 18] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx debug
[ 19] Map Manager 2.5.61 Mistrick mapmanager.amxx debug
[ 20] Pause Plugins 1.8.3-Re AMXX Dev Team pausecfg.amxx debug
[ 21] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx debug
[ 22] Restrict Weapons 1.8.3-Re AMXX Dev Team restmenu.amxx debug
[ 23] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a debug
[ 24] [ReAPI] VIP System 1.3.1 pUzzlik re_vip_system.a debug
[ 25] Weapon Menu 1.0 Mattcook & xerob weaponmenu.amxx debug
[ 26] [ReAPI] Random Weapons 2.4.4 neugomon random_weapons_ debug
[ 27] [ReAPI] Best player of 0.6 F@nt0M best_player_of_ debug
[ 28] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a debug
[ 29] Mode 2x2 2.5re s1lent mode.amxx debug
[ 30] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am debug
[ 31] Advert Messages 1.22 neygomon adverts.amxx debug
[ 32] AFK Control 1.4.1 [Rnd neygomon afk_control.amx debug
[ 33] DemoRecoder 1.1 neygomon amx_demorec.amx debug
[ 34] Bullet Damage 0.0.1 ConnorMcLeod bullet_damage.a debug
[ 35] FM ResetScore 0.1 neygomon fm_rs.amxx debug
[ 36] Hud_info 2.1 h1k3 hud_info.amxx debug
[ 37] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx debug
[ 38] Lite Kill Assist 1.17 neygomon lite_kill_assis debug
[ 39] Lite VoteBan 1.4 neygomon lite_voteban.am debug
[ 40] MsgChangeName 2.2 Javekson & F@nt0 MsgChangeName.a debug
[ 41] Replace Info Message 2.3 maeStro aka 9iky replace_info_ms debug
[ 42] [ReAPI] Round Balancer 1.1 neygomon round_balancer. debug
[ 43] StatsX (MastaMan Editi 1.8.2 AMXX Dev Team & statsx_shell.am debug
[ 44] Lite Translit 2.8 neygomon lite_translit.a debug
[ 45] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx debug
[ 46] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike debug
[ 47] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am debug
[ 48] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. debug
[ 49] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste debug
[ 50] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri debug
50 plugins, 50 running
Исходный код
#include <amxmodx>
#include <sqlx>
#tryinclude <reapi>
const REASON_LENGTH = 64;

#define DB_HOST "" // MySQL Host
#define DB_USER "" // MySQL User
#define DB_PASS "" // MySQL Password
#define DB_NAME "" // MySQL Name

#define CLEAR_PERIOD 5 // Через сколько дней удалять истекшие GAG'и из MySQL

#define SORRY // Разрешить команду /sorry для извинения игроков
#define MUTEMENU // Поддержка команды /mute
#define GAG_ACCESS ADMIN_BAN // Доступ к функциям гага
#define SORRYTIME 60 // Как часто можно пользоваться командой /sorry. Время в секундах
#define PREFIX "Кляп" // Префикс в чате
#define SUPERADMIN ADMIN_RCON // Админ с флагом L может гагать других админов с иммунитетом

//#define CHATS_BY_STATS // Включает функции блокировки чата игрокам, которые не набрали N фрагов/опыта на сервере
#define VOICE_CONTROL_BY_STATS 0
// 0 - CSX
// 1 - CSSTATS MYSQL by SKAJIbnEJIb
// 2 - CSSTATSX SQL by serfreeman1337
// 3 - AES 0.5 Vega by serfreeman1337
#define BLOCK_TEXT_CHAT
// Блокировать текстовый чат и голосовой
// Если закомментировано - блокировуется только голос
#define BLOCK_CHATS_INFO
// Выводит в текстовый чат сообщение о том, что чат/чаты для игрока заблокированы
const MIN_FRAGS = 10;
// Минимальное количество фрагов для доступа к микро
// Для VOICE_CONTROL_BY_STATS 3 настройка принимает значение ранга юзера(начиная с 1)
const ADMIN_FLAG = ADMIN_IMMUNITY;
// Флаг доступа, для которого не будут работать функции CHATS_BY_STATS

new g_BlockTimes[] = // Время блокировки GAG в минутах
{
5,
10,
30,
60,
180,
0 // навсегда
}

new g_Reasons[][REASON_LENGTH] = // Причины GAG'ов
{
"Нет 16 лет",
"Много говоришь",
"Неадекват",
"Спам, флуд"
}

new g_AllowCommands[][] = // Разрешенные команды
{
"/me",
"/top15",
"/rank",
"/hp"
}

/* Словарь плагина */
#define MSG_SORRY_FLOOD "^1[^4%s^1] ^3Прекратите флудить! ^4Повторно извиниться можно через ^3%d сек"
#define MSG_SORRY_ADMIN "^1[^4%s^1] ^4Уважаемый ^3адмнистратор^4, ^3%s ^4просит снять ^3GAG^4! Причина GAG'a ^3%s"
#define MSG_CHAT_IS_BLOCKED "^1[^4%s^1] ^4Уважаемый ^3%s^4, Ваш чат ^3заблокирован^4! Причина ^3%s"
#define MSG_BLOCK_EXPIRED_TIME "^1[^4%s^1] ^4До разблокировки осталось ^1примерно ^3%d ^4мин."
#define MSG_BLOCK_EXPIRED "^1[^4%s^1] ^4Время блокировки ^3истекло^4. ^1Подождите обновления информации ..."
#define MSG_SAY_SORRY "^1[^4%s^1] ^4Чтобы извиниться, напишите в чат ^3/sorry^4. Возможно, разблокируют раньше :)"
#define MSG_CHAT_UNBLOCK_ALL "^1[^4%s^1] ^4Игроку ^3%s ^4был разблокирован чат администратором ^3%s"
#define MSG_CHAT_UNBLOCK_PL "^1[^4%s^1] ^4Уважаемый ^3%s^4, администратор ^3%s ^4снял с Вас блокировку чата"
#define MSG_CHAT_BLOCK_ALL "^1[^4%s^1] ^4Администратор ^3%s ^4заблокировал чат игроку ^3%s ^1%s^4. Причина ^3%s"
#define MSG_CHAT_BLOCK_PL "^1[^4%s^1] ^4Уважаемый ^3%s^4, администратор ^3%s ^4заблокировал Вам чат ^1%s^4. Причина ^3%s"
#define MSG_MUTE_ALL_PLAYERS "^1[^4%s^1] ^4Вы установили mute на ^3всех ^4игроков."
#define MSG_UNMUTE_ALL_PLAYERS "^1[^4%s^1] ^4Вы сняли mute со ^3всех ^4игроков."
#define MSG_UNMUTE_PLAYER "^1[^4%s^1] ^4Вы сняли ^3mute ^4с игрока ^3%s^4."
#define MSG_MUTE_PLAYER "^1[^4%s^1] ^4Вы установили ^3mute ^4на игрока ^3%s^4."
#define MSG_BLOCK_CHATS0 "^1[^4%s^1] ^4Доступ к текстовому и голосовому чатам ^3закрыт^4!"
#define MSG_BLOCK_CHATS1 "^1[^4%s^1] ^4Доступ к голосовому чату ^3закрыт^4!"
#define MSG_BLOCK_CHATS2 "^1[^4%s^1] ^4Необходимо получить уровень ^3%s!"
#define MSG_BLOCK_CHATS3 "^1[^4%s^1] ^4Необходимо набрать ^3%i^1/^3%i ^4фрагов"

/* Технические данные */

enum _:MENU_SETTINGS
{
Menu,
SelectTime,
SelectReason,
Pos
};
enum _:BlockInfo
{
expired,
reason[REASON_LENGTH],
bool:chatsGAG,
bool:chatsSTATS
};
enum MENUS
{
GAG,
MUTE
};
enum queStates
{
SQL_INIT,
DROP_TABLE,
LOAD_PLAYER,
SAVE_BLOCK,
REMOVE_BLOCK
};

#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32;
#endif
new Handle:g_hTuple, g_szQuery[2048], g_Data[3];
new g_BlockInfo[MAX_PLAYERS + 1][BlockInfo];
new Trie:g_tAllowCmds;
new pl[MAX_PLAYERS], pnum;
new g_iMutePlayer[MAX_PLAYERS + 1][MAX_PLAYERS + 1];
new g_arrPlayers[MAX_PLAYERS + 1][MAX_PLAYERS];
new g_iMenuInfo[MAX_PLAYERS + 1][MENU_SETTINGS];
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif
#if !defined _reapi_included
#include <VtcApi>
#endif
#if defined MUTEMENU
#include <fakemeta>
#endif
#if defined CHATS_BY_STATS
#if VOICE_CONTROL_BY_STATS == 0
#include <csstats>
#endif
#if VOICE_CONTROL_BY_STATS == 1
#include <csstats_mysql>
#endif
#if VOICE_CONTROL_BY_STATS == 2
#include <csstatsx_sql>
#endif
#if VOICE_CONTROL_BY_STATS == 3
#include <aes_v>
#endif
#if !defined _reapi_included
#include <hamsandwich>
#endif
#if defined BLOCK_CHATS_INFO
new g_iFragStats[MAX_PLAYERS + 1];
#if VOICE_CONTROL_BY_STATS == 3
new g_szAesLevelName[64];
#endif
#endif
#endif
public plugin_natives()
{
register_native("ucc_is_client_gaged", "native_ucc_is_client_gaged");
register_native("ucc_set_client_gag", "native_ucc_set_client_gag");
}

public plugin_init()
{
#define PNAME "Ultimate Chats Control"
#define VERSION "3.3"
#define AUTHOR "neygomon"
register_plugin(PNAME, VERSION, AUTHOR);
register_cvar("ucc_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
#if defined _reapi_included
if(has_vtc())
{
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
#if defined CHATS_BY_STATS
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true);
#endif
}
#if !defined MUTEMENU
else set_fail_state("Needed meta plugin VTC [https://my-amxx.ru/threads/257/]");
#endif
#else
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
#if defined CHATS_BY_STATS
RegisterHam(Ham_Spawn, "player", "CBasePlayer_Spawn_Post", true);
#endif
#endif
#if defined MUTEMENU
register_clcmd("say /mute", "ClCmdMuteMenu");
register_clcmd("say_team /mute", "ClCmdMuteMenu");

register_forward(FM_Voice_SetClientListening, "SetClientListening_Pre", false);
#endif
#if defined SORRY
register_clcmd("say /sorry", "SaySorry");
register_clcmd("say_team /sorry", "SaySorry");
#endif
register_clcmd("say", "SayChat");
register_clcmd("say_team", "SayChat");

register_srvcmd("uсc_flush", "SrvCmdFlush");

register_menucmd(register_menuid("UCC Menu"), 1023, "MenuHandler");

set_task(60.0, "CheckBlockedUsers", .flags = "b");
}

public plugin_cfg()
{
SQL_Init();
#if defined CHATS_BY_STATS && defined BLOCK_CHATS_INFO && VOICE_CONTROL_BY_STATS == 3
set_task(1.0, "task__aes_get_level_name"); // fucking serfreeman1337. govnocoder
#endif
g_tAllowCmds = TrieCreate();
for(new i; i < sizeof g_AllowCommands; ++i)
TrieSetCell(g_tAllowCmds, g_AllowCommands[i], i);
}
#if defined CHATS_BY_STATS && defined BLOCK_CHATS_INFO && VOICE_CONTROL_BY_STATS == 3
public task__aes_get_level_name()
{
aes_get_level_name(MIN_FRAGS, g_szAesLevelName, charsmax(g_szAesLevelName), LANG_SERVER);
}
#endif
public client_putinserver(id)
{
if(is_user_bot(id) || is_user_hltv(id))
return;

g_BlockInfo[id][expired] = -1;
g_BlockInfo[id][reason][0] = EOS;
g_BlockInfo[id][chatsGAG] = false;
g_BlockInfo[id][chatsSTATS]= false;

arrayset(g_iMutePlayer[id], 0, sizeof g_iMutePlayer[]);
#if defined CHATS_BY_STATS
if(get_chats_access(id))
{
new szIP[16], szAuth[32];
get_user_ip(id, szIP, charsmax(szIP), 1);
get_user_authid(id, szAuth, charsmax(szAuth));

formatex(g_szQuery, charsmax(g_szQuery),
"SELECT `expired_time`, `reason` FROM `ucc_gag` WHERE (`ip` = '%s' OR `steamid` = '%s') AND `expired_time` >= '0'",
szIP, szAuth
);

g_Data[0] = LOAD_PLAYER;
g_Data[1] = id;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", g_szQuery, g_Data, sizeof(g_Data));
}
else
{
VTC_MuteClient(id);
#if defined BLOCK_TEXT_CHAT
g_BlockInfo[id][chatsSTATS] = true;
#endif
}
#else
new szIP[16], szAuth[32];
get_user_ip(id, szIP, charsmax(szIP), 1);
get_user_authid(id, szAuth, charsmax(szAuth));

formatex(g_szQuery, charsmax(g_szQuery),
"SELECT `expired_time` FROM `ucc_gag` WHERE (`ip` = '%s' OR `steamid` = '%s') AND `expired_time` >= '0'",
szIP, szAuth
);

g_Data[0] = LOAD_PLAYER;
g_Data[1] = id;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", g_szQuery, g_Data, sizeof(g_Data));
#endif
}
#if defined MUTEMENU
public SetClientListening_Pre(iReciever, iSender)
{
if(iSender != iReciever)
{
if(g_iMutePlayer[iReciever][iSender])
{
engfunc(EngFunc_SetClientListening, iReciever, iSender, false);
forward_return(FMV_CELL, false);
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
#endif
#if defined SORRY
public SaySorry(id)
{
if(g_BlockInfo[id][chatsGAG])
{
static iFloodTime[MAX_PLAYERS + 1], systime;
if(iFloodTime[id] > (systime = get_systime()))
ChatColor(id, 0, MSG_SORRY_FLOOD, PREFIX, iFloodTime[id] - systime);
else
{
new sName[32];
get_user_name(id, sName, charsmax(sName));

get_players(pl, pnum, "ch");
for(new i; i < pnum; ++i)
{
if(get_user_flags(pl[i]) & GAG_ACCESS)
ChatColor(pl[i], 0, MSG_SORRY_ADMIN, PREFIX, sName, g_BlockInfo[id][reason]);
}

iFloodTime[id] = systime + SORRYTIME;
}
}
return PLUGIN_HANDLED;
}
#endif
public SayChat(id)
{
#if defined CHATS_BY_STATS && defined BLOCK_TEXT_CHAT
if(!g_BlockInfo[id][chatsGAG] && !g_BlockInfo[id][chatsSTATS])
#else
if(!g_BlockInfo[id][chatsGAG])
#endif
return PLUGIN_CONTINUE;

new sMessage[128];
read_args(sMessage, charsmax(sMessage));
remove_quotes(sMessage);

if(TrieKeyExists(g_tAllowCmds, sMessage))
return PLUGIN_CONTINUE;
else if(g_BlockInfo[id][chatsGAG])
{
new sName[32], ost;
get_user_name(id, sName, charsmax(sName));
ChatColor(id, 0, MSG_CHAT_IS_BLOCKED, PREFIX, sName, g_BlockInfo[id][reason]);

if(g_BlockInfo[id][expired] > 0)
{
if((ost = g_BlockInfo[id][expired] - get_systime()) / 60 > 0)
ChatColor(id, 0, MSG_BLOCK_EXPIRED_TIME, PREFIX, ost / 60);
else ChatColor(id, 0, MSG_BLOCK_EXPIRED, PREFIX);
}

ChatColor(id, 0, MSG_SAY_SORRY, PREFIX);
}
#if defined CHATS_BY_STATS && defined BLOCK_CHATS_INFO
else
{
ChatColor(id, 0, MSG_BLOCK_CHATS0, PREFIX);
#if VOICE_CONTROL_BY_STATS == 3
ChatColor(id, 0, MSG_BLOCK_CHATS2, PREFIX, g_szAesLevelName);
#else
ChatColor(id, 0, MSG_BLOCK_CHATS3, PREFIX, g_iFragStats[id], MIN_FRAGS);
#endif
}
#endif
return PLUGIN_HANDLED;
}
#if defined CHATS_BY_STATS
public CBasePlayer_Spawn_Post(const id)
{
if(!is_user_connected(id))
return;
if(g_BlockInfo[id][chatsGAG])
return;

if(get_chats_access(id))
{
VTC_UnmuteClient(id);
#if defined BLOCK_TEXT_CHAT
g_BlockInfo[id][chatsSTATS] = false;
#endif
}
#if defined BLOCK_CHATS_INFO
else
{
#if defined BLOCK_TEXT_CHAT
ChatColor(id, 0, MSG_BLOCK_CHATS0, PREFIX);
#else
ChatColor(id, 0, MSG_BLOCK_CHATS1, PREFIX);
#endif
#if VOICE_CONTROL_BY_STATS == 3
ChatColor(id, 0, MSG_BLOCK_CHATS2, PREFIX, g_szAesLevelName);
#else
ChatColor(id, 0, MSG_BLOCK_CHATS3, PREFIX, g_iFragStats[id], MIN_FRAGS);
#endif
}
#endif
}
#endif
public SrvCmdFlush()
{
g_Data[0] = DROP_TABLE;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", "TRUNCATE `ucc_gag`", g_Data, sizeof(g_Data));

for(new id; id < sizeof g_BlockInfo; ++id)
{
g_BlockInfo[id][expired] = -1;
g_BlockInfo[id][chatsGAG] = false;
g_BlockInfo[id][chatsSTATS] = false;
}

log_amx("%s [v: %s][a: %s] flushed all gags", PNAME, VERSION, AUTHOR);
}

public CheckBlockedUsers()
{
get_players(pl, pnum);
for(new i, sys = get_systime(); i < pnum; ++i)
{
if(g_BlockInfo[pl[i]][expired] > 0)
{
if(sys > g_BlockInfo[pl[i]][expired])
user_unblock(pl[i]);
}
}
}

public ClCmdGagMenu(id)
{
if(get_user_flags(id) & GAG_ACCESS)
{
g_iMenuInfo[id][SelectTime] = 0;
g_iMenuInfo[id][Pos] = 0;
g_iMenuInfo[id][Menu] = any:GAG;

ShowMenu(id, 0);
}

return PLUGIN_HANDLED;
}

public ClCmdMuteMenu(id)
{
g_iMenuInfo[id][Pos] = 0;
g_iMenuInfo[id][Menu] = any:MUTE;

ShowMenu(id, 0);
return PLUGIN_HANDLED;
}

const MENU_ITEMS = 6;
ShowMenu(id, iPos)
{
new start, end;
new iLen, sMenu[512];
new iKeys = MENU_KEY_0|MENU_KEY_7|MENU_KEY_8;
get_players(g_arrPlayers[id], pnum, "ch");

start = iPos * MENU_ITEMS;
end = start + MENU_ITEMS;

switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
iLen = formatex(sMenu, charsmax(sMenu), "\d[\rAMX Gag\d] \yВыберите игрока\w\R%d/%d^n^n", iPos + 1, (pnum / MENU_ITEMS + ((pnum % MENU_ITEMS) ? 1 : 0)));
}
case MUTE:
{
iLen = formatex(sMenu, charsmax(sMenu), "\d[\rMute\d] \yВыберите игрока\w\R%d/%d^n^n", iPos + 1, (pnum / MENU_ITEMS + ((pnum % MENU_ITEMS) ? 1 : 0)));
}
}

if(start >= pnum)
start = iPos = g_iMenuInfo[id][Pos] = 0;
if(end > pnum)
end = pnum;

switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
#if defined SUPERADMIN
for(new i = start, bool:superadmin = bool:(get_user_flags(id) & SUPERADMIN), sName[32], plr, a; i < end; ++i)
#else
for(new i = start, sName[32], plr, a; i < end; ++i)
#endif
{
plr = g_arrPlayers[id][i];
get_user_name(plr, sName, charsmax(sName));

if(id == plr)
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \y[\rЭто Вы\y]^n", ++a, sName);
#if defined SUPERADMIN
else if(!superadmin && get_user_flags(plr) & ADMIN_IMMUNITY)
#else
else if(get_user_flags(plr) & ADMIN_IMMUNITY)
#endif
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \y[\rImmunity\y]^n", ++a, sName);
#if defined CHATS_BY_STATS
else if(g_BlockInfo[plr][chatsSTATS])
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \y[\rLowStats\y]^n", ++a, sName);
#endif
else
{
iKeys |= (1 << a++);

if(g_BlockInfo[plr][chatsGAG])
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \w%s \d[\yUngag\d]^n", a, sName);
else iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \w%s%s^n", a, sName, VTC_IsClientSpeaking(plr) ? " \d[\rSpeaking\d]" : "");
}
}

if(!g_BlockTimes[g_iMenuInfo[id][SelectTime]])
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "^n\r7. \wGag\d'\wнуть \rнавсегда^n");
else iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "^n\r7. \wGag\d'\wнуть на \y%d \wмин^n", g_BlockTimes[g_iMenuInfo[id][SelectTime]]);

iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r8. \wReason: \r%s^n^n", g_Reasons[g_iMenuInfo[id][SelectReason]]);
}
case MUTE:
{
for(new i = start, sName[32], plr, a; i < end; ++i)
{
plr = g_arrPlayers[id][i];
get_user_name(plr, sName, charsmax(sName));

if(id == plr)
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \y[\rЭто Вы\y]^n", ++a, sName);
else
{
iKeys |= (1 << a++);
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \w%s%s^n", a, sName, g_iMutePlayer[id][plr] ? " \d[\yMuted\d]" : "");
}
}

iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "^n\r7. \wЗаглушить \rвсех^n\r8. \wСнять Mute со \rвсех^n^n");
}
}

if(end != pnum)
{
formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r9. \yДалее^n\r0. \r%s", iPos ? "Назад" : "Выход");
iKeys |= MENU_KEY_9;
}
else formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r0. \r%s", iPos ? "Назад" : "Выход");

show_menu(id, iKeys, sMenu, -1, "UCC Menu");
return PLUGIN_HANDLED;
}

public MenuHandler(id, iKey)
{
switch(iKey)
{
case 6:
{
switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
if(++g_iMenuInfo[id][SelectTime] > charsmax(g_BlockTimes))
g_iMenuInfo[id][SelectTime] = 0;

ShowMenu(id, g_iMenuInfo[id][Pos]);
}
case MUTE:
{
arrayset(g_iMutePlayer[id], 1, sizeof g_iMutePlayer[]);
ChatColor(id, 0, MSG_MUTE_ALL_PLAYERS, PREFIX);
}
}
}
case 7:
{
switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
if(++g_iMenuInfo[id][SelectReason] > charsmax(g_Reasons))
g_iMenuInfo[id][SelectReason] = 0;

ShowMenu(id, g_iMenuInfo[id][Pos]);
}
case MUTE:
{
arrayset(g_iMutePlayer[id], 0, sizeof g_iMutePlayer[]);
ChatColor(id, 0, MSG_UNMUTE_ALL_PLAYERS, PREFIX);
}
}
}
case 8: ShowMenu(id, ++g_iMenuInfo[id][Pos]);
case 9:
{
if(g_iMenuInfo[id][Pos])
ShowMenu(id, --g_iMenuInfo[id][Pos]);
}
default:
{
switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
GagHandler(
id,
g_arrPlayers[id][g_iMenuInfo[id][Pos] * MENU_ITEMS + iKey],
g_BlockTimes[g_iMenuInfo[id][SelectTime]],
g_Reasons[g_iMenuInfo[id][SelectReason]]
);
}
case MUTE:
{
MuteHandler(id, g_arrPlayers[id][g_iMenuInfo[id][Pos] * MENU_ITEMS + iKey]);
}
}
}
}
return PLUGIN_HANDLED;
}

GagHandler(id, player, blocktime, blockreason[REASON_LENGTH])
{
if(!is_user_connected(player))
return;

new sNameAdmin[32], sNamePlayer[32];
get_user_name(id, sNameAdmin, charsmax(sNameAdmin));
get_user_name(player, sNamePlayer, charsmax(sNamePlayer));

if(g_BlockInfo[player][chatsGAG])
{
user_unblock(player);

ChatColor(0, player, MSG_CHAT_UNBLOCK_ALL, PREFIX, sNamePlayer, sNameAdmin);
ChatColor(player, 0, MSG_CHAT_UNBLOCK_PL, PREFIX, sNamePlayer, sNameAdmin);
}
else
{
user_block(player, id, blocktime, blockreason);

new blocktimeinfo[32];
if(!blocktime)
formatex(blocktimeinfo, charsmax(blocktimeinfo), "навсегда");
else formatex(blocktimeinfo, charsmax(blocktimeinfo), "на %d минут", blocktime);

ChatColor(0, player, MSG_CHAT_BLOCK_ALL, PREFIX, sNameAdmin, sNamePlayer, blocktimeinfo, blockreason);
ChatColor(player, 0, MSG_CHAT_BLOCK_PL, PREFIX, sNamePlayer, sNameAdmin, blocktimeinfo, blockreason);
}
ShowMenu(id, g_iMenuInfo[id][Pos]);
}

MuteHandler(id, player)
{
if(!is_user_connected(player))
return;

new sNamePlayer[32];
get_user_name(player, sNamePlayer, charsmax(sNamePlayer));

g_iMutePlayer[id][player] = !g_iMutePlayer[id][player];
ChatColor(id, 0, g_iMutePlayer[id][player] ? MSG_MUTE_PLAYER : MSG_UNMUTE_PLAYER, PREFIX, sNamePlayer);

ShowMenu(id, g_iMenuInfo[id][Pos]);
}

user_block(id, admin, blocktime, blockreason[REASON_LENGTH])
{
VTC_MuteClient(id);
client_cmd(id, "-voicerecord");

new iSystime = get_systime();
g_BlockInfo[id][chatsGAG] = true;
g_BlockInfo[id][expired] = !blocktime ? 0 : iSystime + blocktime * 60;
formatex(g_BlockInfo[id][reason], charsmax(g_BlockInfo[][reason]), blockreason);

new szName[32], szIP[16], szAuth[32];
get_user_name(id, szName, charsmax(szName));
get_user_ip(id, szIP, charsmax(szIP), 1);
get_user_authid(id, szAuth, charsmax(szAuth));

new szAdminName[32], szAdminIP[16], szAdminAuth[32];
get_user_name(admin, szAdminName, charsmax(szAdminName));
get_user_ip(admin, szAdminIP, charsmax(szAdminIP), 1);
get_user_authid(admin, szAdminAuth, charsmax(szAdminAuth));

formatex(g_szQuery, charsmax(g_szQuery),
"INSERT INTO `ucc_gag` (`name`, `steamid`, `ip`, `admin_name`, `admin_steamid`, `admin_ip`, `create_time`, `expired_time`, `reason`) \
VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s') \
ON DUPLICATE KEY UPDATE `name` = '%s', `ip` = '%s', `admin_name` = '%s', `admin_steamid` = '%s', `admin_ip` = '%s', `create_time` = '%d', `expired_time` = '%d', `reason` = '%s'",
szName, szAuth, szIP, szAdminName, szAdminAuth, szAdminIP, iSystime, g_BlockInfo[id][expired], g_BlockInfo[id][reason],
szName, szIP, szAdminName, szAdminAuth, szAdminIP, iSystime, g_BlockInfo[id][expired], g_BlockInfo[id][reason]
);

g_Data[0] = SAVE_BLOCK;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", g_szQuery, g_Data, sizeof(g_Data));
}

user_unblock(id)
{
g_BlockInfo[id][expired] = -1;
g_BlockInfo[id][reason][0]= EOS;
g_BlockInfo[id][chatsGAG] = false;
VTC_UnmuteClient(id);

new szIP[16], szAuth[32];
get_user_ip(id, szIP, charsmax(szIP), 1);
get_user_authid(id, szAuth, charsmax(szAuth));

formatex(g_szQuery, charsmax(g_szQuery), "UPDATE `ucc_gag` SET `expired_time` = '-1' WHERE `ip` = '%s' OR `steamid` = '%s'", szIP, szAuth);

g_Data[0] = REMOVE_BLOCK;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", g_szQuery, g_Data, sizeof(g_Data));
}

SQL_Init()
{
SQL_SetAffinity("mysql");
g_hTuple = SQL_MakeDbTuple(DB_HOST, DB_USER, DB_PASS, DB_NAME, 1);

new errcode, errstr[128], Handle:hTest = SQL_Connect(g_hTuple, errcode, errstr, charsmax(errstr));
if(hTest == Empty_Handle)
{
#if AMXX_VERSION_NUM < 183
new szError[128]; formatex(szError, charsmax(szError), "[SQL ERROR #%d] %s", errcode, errstr);
set_fail_state(szError);
#else
set_fail_state("[SQL ERROR #%d] %s", errcode, errstr);
#endif
}
else
{
SQL_FreeHandle(hTest);
#if AMXX_VERSION_NUM >= 183
SQL_SetCharset(g_hTuple, "utf8");
#endif
new iClearPeriod = get_systime() - 86400 * CLEAR_PERIOD;
// superfix compile for amxx 1.8.2
new iLen = formatex(g_szQuery, charsmax(g_szQuery),
"CREATE TABLE IF NOT EXISTS `ucc_gag` ( \
`id` smallint(6) NOT NULL AUTO_INCREMENT, \
`name` varchar(32) NOT NULL, \
`steamid` varchar(32) NOT NULL, \
`ip` varchar(16) NOT NULL, \
`admin_name` varchar(32) NOT NULL, \
`admin_steamid` varchar(32) NOT NULL, \
`admin_ip` varchar(32) NOT NULL, ");
formatex(g_szQuery[iLen], charsmax(g_szQuery),
"`create_time` int(11) NOT NULL, \
`expired_time` int(11) NOT NULL, \
`reason` varchar(%d) NOT NULL, \
PRIMARY KEY (`id`), \
UNIQUE KEY `steamid` (`steamid`) \
)ENGINE=InnoDB DEFAULT CHARSET=utf8; \
DELETE FROM `ucc_gag` WHERE (`expired_time` < '%d' AND `expired_time` > '0') OR (`expired_time` = '-1' AND `create_time` < '%d');",
REASON_LENGTH, iClearPeriod, iClearPeriod);

g_Data[0] = SQL_INIT;
SQL_ThreadQuery(g_hTuple, "SQL_ThreadsHandler", g_szQuery, g_Data, sizeof(g_Data));
}
}

public SQL_ThreadsHandler(failstate, Handle:query, err[], errcode, data[], datasize)
{
switch(failstate)
{
case TQUERY_CONNECT_FAILED, TQUERY_QUERY_FAILED:
{
log_amx("[SQL ERROR #%d] %s", errcode, err);
return;
}
}

switch(data[0])
{
case SQL_INIT, DROP_TABLE, SAVE_BLOCK, REMOVE_BLOCK: {}
case LOAD_PLAYER:
{
if(SQL_NumResults(query))
{
VTC_MuteClient(data[1]);

g_BlockInfo[data[1]][expired] = SQL_ReadResult(query, 0);
g_BlockInfo[data[1]][chatsGAG] = true;
SQL_ReadResult(query, 1, g_BlockInfo[data[1]][reason], charsmax(g_BlockInfo[][reason]));
}
}
}
}

public native_ucc_is_client_gaged(plugin, params)
{
enum { index = 1, exp_time, gag_reason };

new id = get_param(index);

if(is_user_connected(id))
{
set_param_byref(exp_time, g_BlockInfo[id][expired]);
set_string(gag_reason, g_BlockInfo[id][reason], charsmax(g_BlockInfo[][reason]));

return g_BlockInfo[id][chatsGAG];
}

log_error(AMX_ERR_NATIVE, "Client %d not connected or index out of range!", id);
return -1;
}

public native_ucc_set_client_gag(plugin, params)
{
enum { index = 1, admin_id, block_time, gag_reason };

new id = get_param(index);
new admin = get_param(admin_id);

if(!is_user_connected(id))
{
log_error(AMX_ERR_NATIVE, "Client %d not connected or index out of range!", id);
return 0;
}
if(!is_user_connected(admin))
admin = 0;

new szReason[REASON_LENGTH];
get_string(gag_reason, szReason, charsmax(szReason));

user_block(id, admin, get_param(block_time), szReason);
return 1;
}

public plugin_end()
{
SQL_FreeHandle(g_hTuple);
TrieDestroy(g_tAllowCmds);
}
#if defined CHATS_BY_STATS
bool:get_chats_access(id)
{
if(get_user_flags(id) & ADMIN_FLAG)
return true;
#if VOICE_CONTROL_BY_STATS == 0
new st[8], bh[HIT_RIGHTLEG + 1];
if(!get_user_stats(id, st, bh))
return false;
#endif
#if VOICE_CONTROL_BY_STATS == 1
new st[22];
if(csstats_get_user_stats(id, st) <= 0)
return false;
#endif
#if VOICE_CONTROL_BY_STATS == 2
new st[8], bh[HIT_RIGHTLEG + 1];
if(!get_user_stats_sql(id, st, bh))
return false;
#endif
#if VOICE_CONTROL_BY_STATS == 3
new st[1]; st[0] = aes_get_player_level(id);
if((st[0] = aes_get_player_level(id)) == -1)
return false;
#endif
#if defined BLOCK_CHATS_INFO
g_iFragStats[id] = st[0];
#endif
return (st[0] < MIN_FRAGS) ? false : true;
}
#endif
stock ChatColor(id, id2, const szMessage[], any:...)
{
new szMsg[190];
vformat(szMsg, charsmax(szMsg), szMessage, 4);

if(id)
{
client_print_color(id, print_team_default, szMsg);
}
else
{
get_players(pl, pnum, "c");
for(new i; i < pnum; ++i)
{
if(pl[i] != id2)
{
client_print_color(pl[i], print_team_default, szMsg);
}
}
}
}
Все остальные функции плагина работают, а вот админское меню упало
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
73
Реакции
39
Помог
3 раз(а)
VoiceTranscoder должен быть выше AMX Mod X
 
Сообщения
68
Реакции
8
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Sherlok_h, ничего не изменилось
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
TrapManiak, Попробуй UCC поставить в самый верх списка плагинов.
 

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

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