не работает amx_gagmenu

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
12
Реакции
0
Ошибка
Команда /mute работает исправно. /gag и amx_gagmenu даже не открывают меню.
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5249 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jun 19 2019 13:31:53
Built from: https://github.com/alliedmodders/amxmodx/commit/6cecb34
Build ID: 5249:6cecb34
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.6.0.672-dev-myarena
ReGamedll
ReGameDLL version: 5.9.0.363-dev
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.so        v0.1.0.92       ini  Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5249 ini Start ANY
[ 4] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 7] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.9.0.171-dev pl3 ANY Never
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5249 pl3 ANY ANY
16 plugins, 16 running
Список плагинов
[  1] FreshBans               1.4.0b      kanagava          fresh_bans_140_  running  
[ 2] DopBan 2.8.2b kanagava dop_ban2.amxx running
[ 3] GameCMS_API 5.3.4 zhorzh78 gamecms_api_5.3 running
[ 4] GameCMS BonusSystem 1.0 DUKKHAZ0R gamecms_bonus.a running
[ 5] GameCMS_Registration 1.5 zhorzh78 gamecms_registr running
[ 6] GameCMS_Informer 2.3 API5 zhorzh78 forum_HUD_infor running
[ 7] GameCMS_Achievs_Core 1.3 zhorzh78 gamecms_achievs running
[ 8] GameCMS_Bomb_Achievs 1.2 zhorzh78 bomb_achievs_1. running
[ 9] GameCMS_Player_Achievs 1.3 zhorzh78 player_achievs_ running
[ 10] GameCMS_Special_Achiev 1.3 zhorzh78 special_achievs running
[ 11] Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
[ 12] Admin Help 1.9.0.5249 AMXX Dev Team adminhelp.amxx running
[ 13] Slots Reservation 1.9.0.5249 AMXX Dev Team adminslots.amxx running
[ 14] Multi-Lingual System 1.9.0.5249 AMXX Dev Team multilingual.am running
[ 15] Menus Front-End 1.9.0.5249 AMXX Dev Team menufront.amxx running
[ 16] Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
[ 17] Players Menu 1.9.0.5235 AMXX Dev Team plmenu.amxx running
[ 18] Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
[ 19] Plugin Menu 1.9.0.5249 AMXX Dev Team pluginmenu.amxx running
[ 20] Admin Chat 1.8.2 AMXX Dev Team adminchat.amxx running
[ 21] Anti Flood 1.9.0.5249 AMXX Dev Team antiflood.amxx running
[ 22] Scrolling Message 1.9.0.5249 AMXX Dev Team scrollmsg.amxx running
[ 23] Info. Messages 1.9.0.5249 AMXX Dev Team imessage.amxx running
[ 24] Admin Votes 1.9.0.5249 AMXX Dev Team adminvote.amxx running
[ 25] Pause Plugins 1.9.0.5249 AMXX Dev Team pausecfg.amxx running
[ 26] Stats Configuration 1.9.0.5249 AMXX Dev Team statscfg.amxx running
[ 27] Restrict Weapons 1.9.0.5249 AMXX Dev Team restmenu.amxx running
[ 28] StatsX 1.9.0.5249 AMXX Dev Team statsx.amxx running
[ 29] AIM detector 0.7.4e kanagava aim_detector.am running
[ 30] Check Button 2.1 Juice/Inj checkbutton_inj running
[ 31] BhopHack Detector 0.1 Mistrick bhophack_detect running
[ 32] SGS and DD run Hack De 1.0 Seroff SGS_and_DD_Dete running
[ 33] Admin Check [MOTD] 1.0 Seroff admincheck.amxx running
[ 34] Advert Messages 1.22 neygomon adverts.amxx running
[ 35] Advanced Gag 1.9.2 neygomon/soda amx_gag.amxx running
[ 36] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 37] [ReAPI] Custom Models 1.6.1 neugomon custom_models.a running
[ 38] Damager 1.0 Prayer damager.amxx running
[ 39] Demo recorder 1.0 tahoma demo_record.amx running
[ 40] GameName Changer 1.0 neugomon gamename_change running
[ 41] Team Grenade Trail 1.2 Numb grenade_trail.a running
[ 42] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 43] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 44] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 45] Speclist 0.01 gladius speclist.amxx running
[ 46] unknown unknown unknown hook.amxx running
[ 47] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 48] Steam Bonus 1.1 ill+F@nToM steam_bonus_a2. running
[ 49] [ReAPI] AWPoff 1.3 PAffAEJIkA :3 awp_off.amxx running
49 plugins, 49 running
Автор плагина
neygomon
Версия плагина
1.9.0
Исходный код
#include <amxmodx>
#tryinclude <reapi>
#if !defined _reapi_included
#include <VtcApi>
#endif
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

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

new g_BlockTimes[] = // Время блокировки в минутах
{
5,
10
}

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

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

/* Технические данные */
#if defined MUTEMENU
#include <fakemeta>
#endif

#define STORAGE "addons/amxmodx/data/amx_gag.dat"
#define MAX_ITEMS 1000
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32;
#endif
#define GetBit(%1,%2) (%1 & (1 << (%2 & 31)))
#define SetBit(%1,%2) %1 |= (1 << (%2 & 31))
#define ResetBit(%1,%2) %1 &= ~(1 << (%2 & 31))

enum _:DATA
{
IP[16],
STEAMID[25],
BLOCKTIME
};
enum MENUS
{
GAG,
MUTE
};
enum _:MENU_SETTINGS
{
Menu,
SelectTime,
Pos
};

new g_bitBlockChats;
new g_aLoadedData[MAX_PLAYERS + 1][DATA];
new Trie:g_tAllowCmds, Array:g_aUsersBlocked;
new g_arrData[DATA];
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];

public plugin_init()
{
#define VERSION "1.9.2"
register_plugin("Advanced Gag", VERSION, "neygomon/soda");
register_cvar("adv_gag", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
#if defined _reapi_included
if(has_vtc())
{
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
register_clcmd("say /gag", "ClCmdGagMenu");
register_clcmd("say_team /gag", "ClCmdGagMenu");
}
#if !defined MUTEMENU
else set_fail_state("Needed meta plugin VTC [https://neugomon.ru/threads/257/]");
#endif
#else
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
register_clcmd("say /gag", "ClCmdGagMenu");
register_clcmd("say_team /gag", "ClCmdGagMenu");
#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("adv_flush_gags", "SrvCmdFlush");

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

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

public plugin_cfg()
{
g_aUsersBlocked = ArrayCreate(DATA);

new fp = fopen(STORAGE, "rt");
if(fp)
{
new i, blocktime[15], buffer[128];
new sys = get_systime();

while(!feof(fp) && i < MAX_ITEMS)
{
fgets(fp, buffer, charsmax(buffer));
trim(buffer);

if(buffer[0] == EOS || buffer[0] == ';')
continue;

if(parse(buffer,
g_arrData[IP], charsmax(g_arrData[IP]),
g_arrData[STEAMID], charsmax(g_arrData[STEAMID]),
blocktime, charsmax(blocktime)
)
)
{
g_arrData[BLOCKTIME] = str_to_num(blocktime);
if(!g_arrData[BLOCKTIME] || g_arrData[BLOCKTIME] > sys)
{
ArrayPushArray(g_aUsersBlocked, g_arrData);
i++;
}
}
}
fclose(fp);
}

g_tAllowCmds = TrieCreate();
for(new i; i < sizeof g_AllowCommands; ++i)
TrieSetCell(g_tAllowCmds, g_AllowCommands[i], i);
}

public client_putinserver(id)
{
if(!is_user_bot(id) && !is_user_hltv(id))
{
get_user_ip(id, g_aLoadedData[id][IP], charsmax(g_aLoadedData[][IP]), 1);
get_user_authid(id, g_aLoadedData[id][STEAMID], charsmax(g_aLoadedData[][STEAMID]));

if(IsUserBlocked(id, g_aLoadedData[id][IP], g_aLoadedData[id][STEAMID]) != -1)
{
VTC_MuteClient(id);
SetBit(g_bitBlockChats, id);
}
else ResetBit(g_bitBlockChats, id);

arrayset(g_iMutePlayer[id], 0, sizeof g_iMutePlayer[]);
}
}
#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
public SaySorry(id)
{
if(GetBit(g_bitBlockChats, id))
{
static iFloodTime[33], 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);
}

iFloodTime[id] = systime + SORRYTIME;
}
}
return PLUGIN_HANDLED;
}
public SayChat(id)
{
if(!GetBit(g_bitBlockChats, id))
return PLUGIN_CONTINUE;

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

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

if(g_aLoadedData[id][BLOCKTIME])
{
if((ost = g_aLoadedData[id][BLOCKTIME] - 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);
}
return PLUGIN_HANDLED;
}

public SrvCmdFlush()
{
ArrayClear(g_aUsersBlocked);
log_amx("Advanced Gag [v %s] flush gags", VERSION);

for(new id; id < sizeof g_aLoadedData; ++id)
{
arrayset(g_aLoadedData[id], 0, sizeof g_aLoadedData[]);
ResetBit(g_bitBlockChats, id);
}
}

public CheckBlockedUsers()
{
if(ArraySize(g_aUsersBlocked))
{
get_players(pl, pnum);

for(new i, sys = get_systime(); i < pnum; ++i)
{
if(g_aLoadedData[pl[i]][BLOCKTIME] && sys > g_aLoadedData[pl[i]][BLOCKTIME])
UserBlock(pl[i], 0);
}
}
}

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;
}

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

switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
start = iPos * 7;
end = start + 7;
iLen = formatex(sMenu, charsmax(sMenu), "\d[\rGag\d] \yВыберите игрока\w\R%d/%d^n^n", iPos + 1, (pnum / 7 + ((pnum % 7) ? 1 : 0)));
}
case MUTE:
{
start = iPos * 6;
end = start + 6;
iKeys |= MENU_KEY_7;
iLen = formatex(sMenu, charsmax(sMenu), "\d[\rMute\d] \yВыберите игрока\w\R%d/%d^n^n", iPos + 1, (pnum / 6 + ((pnum % 6) ? 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);
else
{
iKeys |= (1 << a++);

if(GetBit(g_bitBlockChats, plr))
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\r8. \wGag\d'\wнуть \rнавсегда^n^n");
else iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "^n\r8. \wGag\d'\wнуть на \y%d \wмин^n^n", g_BlockTimes[g_iMenuInfo[id][SelectTime]]);
}
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, "Gag Menu");
return PLUGIN_HANDLED;
}

public MenuHandler(id, iKey)
{
switch(iKey)
{
case 6:
{
switch(g_iMenuInfo[id][Menu])
{
case GAG:
{
GagHandler(id, g_arrPlayers[id][g_iMenuInfo[id][Pos] * 7 + iKey], g_BlockTimes[g_iMenuInfo[id][SelectTime]]);
}
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][SelectTime] > charsmax(g_BlockTimes))
g_iMenuInfo[id][SelectTime] = 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] * 7 + iKey], g_BlockTimes[g_iMenuInfo[id][SelectTime]]);
}
case MUTE:
{
MuteHandler(id, g_arrPlayers[id][g_iMenuInfo[id][Pos] * 6 + iKey]);
}
}
}
}
return PLUGIN_HANDLED;
}

GagHandler(id, player, blocktime)
{
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(GetBit(g_bitBlockChats, player))
{
UserBlock(player, 0);

ChatColor(0, player, MSG_CHAT_UNBLOCK_ALL, PREFIX, sNamePlayer, sNameAdmin);
ChatColor(player, 0, MSG_CHAT_UNBLOCK_PL, PREFIX, sNamePlayer, sNameAdmin);
}
else
{
UserBlock(player, 1, blocktime);

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

ChatColor(0, player, MSG_CHAT_BLOCK_ALL, PREFIX, sNameAdmin, sNamePlayer, blocktimeinfo);
ChatColor(player, 0, MSG_CHAT_BLOCK_PL, PREFIX, sNamePlayer, sNameAdmin, blocktimeinfo);
}
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]);
}

UserBlock(id, block, btime = 0)
{
if(block)
{
g_aLoadedData[id][BLOCKTIME] = !btime ? 0 : get_systime() + btime * 60;

ArrayPushArray(g_aUsersBlocked, g_aLoadedData[id]);
SetBit(g_bitBlockChats, id);
VTC_MuteClient(id);
client_cmd(id, "-voicerecord"); // типа отключаем войс, ога
}
else IsUserBlocked(id, g_aLoadedData[id][IP], g_aLoadedData[id][STEAMID], 1);
}

IsUserBlocked(id, const Ip[], const SteamID[], UnBlock = 0)
{
new i, aSize = ArraySize(g_aUsersBlocked), sys = get_systime();

if(UnBlock)
{
for(i = 0; i < aSize; ++i)
{
ArrayGetArray(g_aUsersBlocked, i, g_arrData);
if(strcmp(g_arrData[IP], Ip) == 0 || strcmp(g_arrData[STEAMID], SteamID) == 0)
{
ArrayDeleteItem(g_aUsersBlocked, i);
ResetBit(g_bitBlockChats, id);
VTC_UnmuteClient(id);
break;
}
}
}
else
{
for(i = 0; i < aSize; ++i)
{
ArrayGetArray(g_aUsersBlocked, i, g_arrData);
if(strcmp(g_arrData[IP], Ip) == 0 || strcmp(g_arrData[STEAMID], SteamID) == 0)
{
if(!g_arrData[BLOCKTIME] || g_arrData[BLOCKTIME] > sys)
{
g_aLoadedData[id][BLOCKTIME] = g_arrData[BLOCKTIME];
return i;
}
else ArrayDeleteItem(g_aUsersBlocked, i);

break;
}
}
}
return -1;
}

public plugin_end()
{
if(file_exists(STORAGE))
unlink(STORAGE);

new aSize, fp = fopen(STORAGE, "w+");
if(!fprintf(fp, "; File generated by Advanced Gag [v %s][neygomon | https://neugomon.ru/threads/91/]^n^n", VERSION))
{
new err[128]; formatex(err, charsmax(err), "Plugin not write file %s! Users not saved!", STORAGE);
set_fail_state(err);
}

aSize = ArraySize(g_aUsersBlocked);
for(new i; i < aSize; ++i)
{
ArrayGetArray(g_aUsersBlocked, i, g_arrData);
fprintf(fp, "^"%s^" ^"%s^" ^"%d^"^n", g_arrData[IP], g_arrData[STEAMID], g_arrData[BLOCKTIME]);
}

if(aSize)
{
log_amx("Successfully saved %d items in %s :)", aSize, STORAGE);
}

fclose(fp);
ArrayDestroy(g_aUsersBlocked);
TrieDestroy(g_tAllowCmds);
}

stock ChatColor(id, id2, const szMessage[], any:...)
{
new szMsg[190];
vformat(szMsg, charsmax(szMsg), szMessage, 4);

if(id && id != id2)
{
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);
}
}
}
}
Команда /mute работает исправно. /gag и amx_gagmenu даже не открывают меню.
 
В этой теме было размещено решение! Перейти к решению.

Rey

Сообщения
195
Реакции
190
Помог
5 раз(а)
soda, что в консоли пишет при вводе amx_gagmenu
 
Статус
В этой теме нельзя размещать новые ответы.

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

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