- Ошибка
-
Advanced Gag 1.4.3 от neygomon
- ОС
- Linux
- Amx Mod X
-
v1.9.0.5271
- Билд
-
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.8.0.739-dev+mpatch-myarena.ru
Build date: 13:25:21 Apr 21 2021 (2566)
- ReGamedll
-
Regamedll_CS 5.20.0.492
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker.so v2.5 ini Chlvl ANY
[ 4] WHBlocker RUN - whblocker.so v1.5.697 ini Chlvl ANY
[ 5] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9+MA ini Chlvl ANY
[ 7] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 8] ProcessCmds RUN - processcmds_mm_i386.so v1.1.9 ini Start Never
[ 9] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[10] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[11] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.19.0.211-dev pl9 ANY Never
[13] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl9 ANY Never
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[15] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[17] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
[18] SxGeo RUN - sxgeo_amxx_i386.so v2.2 pl9 ANY Never
[19] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl9 ANY ANY
- Список плагинов
-
[ 1] [190] Ultimate Informe 21.03.23 SKAJIbnEJIb ultimate_inform running
[ 2] [190] ESP RBS 20.06.06 SKAJIbnEJIb & Ko esp_rbs.amxx running
[ 3] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 4] [183] Fast Hack Detect 19.03.12 Valer4 fast_hack_detec running
[ 5] Advanced Rechecker 0.4 F@nt0M rechecker.amxx running
[ 6] BhopHack Detector 0.1 Mistrick bhophack_detect running
[ 7] FreshBans 1.4.3b kanagava fresh_bans.amxx running
[ 8] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 9] [190] Ultimate Weapons 21.03.23 SKAJIbnEJIb ultimate_weapon running
[ 10] [190] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 11] [190] Army Ranks Ultim 20.06.06 SKAJIbnEJIb army_ranks_ulti running
[ 12] [190] Ultimate Models 21.03.23 SKAJIbnEJIb ultimate_models running
[ 13] Menus Front-End 20.06.06 SKAJIbnEJIb & AM amxmodmenu_rbs. running
[ 14] [190] DemoRecorder RBS 20.06.06 SKAJIbnEJIb demorecorder_rb running
[ 15] [190] Ultimate Flags 21.03.24BE SKAJIbnEJIb ultimate_flags. running
[ 16] [190] BonusMenu RBS 20.06.06 SKAJIbnEJIb bonusmenu_rbs.a running
[ 17] [190] MapChooser RBS 20.08.02 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 18] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 19] [190] High Ping Kicker 20.06.06 SKAJIbnEJIb hpk_rbs.amxx running
[ 20] [190] BackWeapons RBS 20.06.06 SKAJIbnEJIb & ho backweapons_rbs running
[ 21] [190] Parachute RBS 20.06.06 SKAJIbnEJIb & KR parachute_rbs.a running
[ 22] [190] Kill Assist RBS 20.06.06 SKAJIbnEJIb & Di killassist_rbs. running
[ 23] [190] AfkKicker RBS 20.08.02 SKAJIbnEJIb afkkicker_rbs.a running
[ 24] [190] Top Award RBS 20.06.06 SKAJIbnEJIb topaward_rbs.am running
[ 25] [190] Chat RBS 20.10.24BE SKAJIbnEJIb chat_rbs.amxx running
[ 26] [190] CsStats MySQL 20.06.06 SKAJIbnEJIb csstats_mysql.a running
[ 27] [190] Stats Configurat 20.06.06 SKAJIbnEJIb & AM statscfg_rbs.am running
[ 28] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 29] admin_loader 0.5.7 kanagava admin_loader.am running
[ 30] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 31] Maps Menu 1.9.0.5235 AMXX Dev Team mapsmenu.amxx running
[ 32] Players Menu 1.7 neugomon plmenu.amxx running
[ 33] Restrict Weapons 1.9.0.5235 AMXX Dev Team restmenu.amxx running
[ 34] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 35] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash_l running
[ 36] Autoresponder/Advertis 0.5 MaximusBrood reklama_in_chat running
[ 37] SpecList 1.5 FatalisDK+Seroff speclist.amxx running
[ 38] Reset Score 0.0.2f wopox1337 ResetScore.amxx running
[ 39] Radio Block 1.0 Mmonster radio.amxx running
[ 40] Mode 2x2 2.5re s1lent mode_2x2.amxx running
[ 41] AWP Restrictions 1.5.1 Radius awp_restriction running
[ 42] [ReAPI] Healthnade 0.0.2 F@nt0M healthnade.amxx running
[ 43] Block Change Name 1.0 DJ_WEST block_change_na running
[ 44] [SxGeo] Connect Info 1.0 s1lent sxgeo_connect_i running
[ 45] Style C4 Timer 3.1 OciXCrom crx_c4timer.amx running
- Автор плагина
- neygomon
- Версия плагина
- 1.4.3
- Исходный код
-
/*
Версии:
* 1.0 Beta 1 - 8. Написание плагина и исправления ошибок
* 1.0 Beta 9. Фикс гага навсегда
* 1.0 Beta 10. Полировка кода
* 1.0 Beta 11. Добавлен /mute
* 1.1. Добавлен "словарь". Выход из беты
* 1.2. Добавлен VoiceTranscoder API for GAG function's
* 1.3. Фикс менюшки в /mute
* 1.4. Фикс блокировки голосового чата
* 1.0 Beta X. //#define MYSQL // Поддержка MySQL | Не актуально. Так сказать это в планах.
*/
#include <amxmodx>
//#define USE_API_VTC
/*
Закомментируйте, если НЕ используете VTC версии не ниже 2017RC (требуется модуль VtcApi !!ИЛИ!! ReAPI последних версий)
Несмотря на доп модуль, это работает намного быстрее, нежели через Fakemeta
Работает только для функции Gag. Надеюсь, простотема допилит.
*/
#define SORRY // Разрешить команду /sorry для извинения игроков
#define MUTEMENU // Поддержка команды /mute
#define GAG_ACCESS ADMIN_SLAY // Доступ к функциям гага
#define SORRYTIME 30 // Как часто можно пользоваться командой /sorry. Время в секундах
#define PREFIX "AMXX" // Префикс в чате
#define SUPERADMIN // Админ с флагом L(изменить можно на 281 строке) может гагать других админов с иммунитетом
new g_BlockTimes[] = // Время блокировки в минутах
{
10,
30,
60,
180,
0 // навсегда
}
new g_AllowCommands[][] = // Разрешенные команды
{
"/me",
"/top15",
"/rank",
"/hp"
}
/* Словарь плагина */
#define MSG_SORRY_FLOOD "^1[^4%s^1] ^3Прекратите флудить^4. ^1Повторно извиниться можно через: ^3%d ^1сек."
#define MSG_SORRY_ADMIN "^1[^4%s^1] Уважаемый ^3Админ^1, игрок ^3%s ^1просит снять с него заглушку."
#define MSG_CHAT_IS_BLOCKED "^1[^4%s^1] Уважаемый ^3%s^1. ^4Ваш чат заблокирован."
#define MSG_BLOCK_EXPIRED_TIME "^1[^4%s^1] До ^3разблокировки ^1осталось примерно: ^3%d ^1мин."
#define MSG_BLOCK_EXPIRED "^1[^4%s^1] Время блокировки истекло. ^4Подождите обновления информации ..."
#define MSG_SAY_SORRY "^1[^4%s^1] Чтобы извиниться, напишите в чат ^3/sorry ^1Возможно, раблокируют раньше ^4:)"
#define MSG_CHAT_UNBLOCK_ALL "^1[^4%s^1] Игроку ^3%s ^1был разблокирован чат админом ^3%s"
#define MSG_CHAT_UNBLOCK_PL "^1[^4%s^1] Уважаемый ^3%s^1. ^4Админ ^3%s ^4снял с Вас блокировку чата^1."
#define MSG_CHAT_BLOCK_ALL "^1[^4%s^1] ^4Админ ^3%s ^4заблокировал чат игроку ^3%s ^1%s"
#define MSG_CHAT_BLOCK_PL "^1[^4%s^1] Уважаемый ^3%s^1. ^4Админ ^3%s ^4заблокировал Вам чат ^1%s"
#define MSG_MUTE_ALL_PLAYERS "^1[^4%s^1] ^3Вы установили mute на всех игроков^1."
#define MSG_UNMUTE_ALL_PLAYERS "^1[^4%s^1] ^3Вы сняли mute со всех игроков^1."
#define MSG_UNMUTE_PLAYER "^1[^4%s^1] Вы сняли mute с игрока ^3%s^1."
#define MSG_MUTE_PLAYER "^1[^4%s^1] Вы установили mute на игрока ^3%s^1."
/* Технические данные */
#if defined USE_API_VTC
#tryinclude <reapi>
#if !defined _reapi_included
#include <VtcApi>
#endif
#endif
#if defined MUTEMENU || !defined USE_API_VTC
#include <fakemeta>
#endif
#define STORAGE "addons/amxmodx/data/amx_gag.dat"
#define MAX_ITEMS 1000
#define GetBit(%1,%2) (%1 & (1 << (%2 & 31)))
#define SetBit(%1,%2) %1 |= (1 << (%2 & 31))
#define ResetBit(%1,%2) %1 &= ~(1 << (%2 & 31))
new g_bitBlockChats;
enum _:DATA
{
IP[16],
STEAMID[25],
BLOCKTIME
};
new g_aLoadedData[33][DATA];
new Trie:g_tAllowCmds;
new Array:g_aUsersBlocked;
new g_arrData[DATA];
new pl[32], pnum;
#if defined MUTEMENU
new g_iMutePlayer[33][33];
#endif
public plugin_init()
{
#if defined USE_API_VTC
#define VERSION "1.4.3[VTC Api]"
#else
#define VERSION "1.4.3"
#endif
register_plugin("Advanced Gag", VERSION, "neygomon");
register_cvar("adv_gag", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
#if defined MUTEMENU || !defined USE_API_VTC
register_forward(FM_Voice_SetClientListening, "FwdSetClientListening", false);
#endif
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
register_menucmd(register_menuid("AmxGag Menu"), 1023, "GagMenuHandler");
#if defined MUTEMENU
register_clcmd("say /mute", "ClCmdMuteMenu");
register_clcmd("say_team /mute", "ClCmdMuteMenu");
register_menucmd(register_menuid("Mute Menu"), 1023, "MuteMenuHandler");
#endif
register_clcmd("say", "SayChat");
register_clcmd("say_team", "SayChat");
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)) return;
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)
SetBit(g_bitBlockChats, id);
else ResetBit(g_bitBlockChats, id);
#if defined MUTEMENU
arrayset(g_iMutePlayer[id], 0, sizeof g_iMutePlayer[]);
#endif
}
#if defined MUTEMENU || !defined USE_API_VTC
public FwdSetClientListening(iReciever, iSender)
{
if(iSender != iReciever)
{
#if !defined USE_API_VTC && defined MUTEMENU
if(GetBit(g_bitBlockChats, iSender) || g_iMutePlayer[iReciever][iSender])
#endif
#if defined MUTEMENU && defined USE_API_VTC
if(g_iMutePlayer[iReciever][iSender])
#endif
{
engfunc(EngFunc_SetClientListening, iReciever, iSender, false);
forward_return(FMV_CELL, false);
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
#endif
public SayChat(id)
{
if(!GetBit(g_bitBlockChats, id))
return PLUGIN_CONTINUE;
static sMessage[128];
read_args(sMessage, charsmax(sMessage));
remove_quotes(sMessage);
if(TrieKeyExists(g_tAllowCmds, sMessage))
return PLUGIN_CONTINUE;
#if defined SORRY
else if(!strcmp(sMessage, "/sorry"))
{
static iFloodTime[33], systime;
if(iFloodTime[id] > (systime = get_systime()))
ChatColor(id, 0, MSG_SORRY_FLOOD, PREFIX, iFloodTime[id] - systime);
else
{
static 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;
}
}
#endif
else
{
static 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 CheckBlockedUsers()
{
static i, sys; sys = get_systime();
get_players(pl, pnum);
for(i = 0; i < pnum; i++)
{
if(g_aLoadedData[pl[i]][BLOCKTIME] && sys > g_aLoadedData[pl[i]][BLOCKTIME])
UserBlock(pl[i], 0);
}
}
new g_iMenuSelectBlock[33], g_iMenuPos[33], players[33][32];
public ClCmdGagMenu(id)
{
if(get_user_flags(id) & GAG_ACCESS)
{
g_iMenuSelectBlock[id] = g_iMenuPos[id] = 0;
ShowGagMenu(id, 0);
}
return PLUGIN_HANDLED;
}
ShowGagMenu(id, iPos)
{
new sMenu[512], iLen, iKeys, sName[32], a, start, end;
get_players(players[id], pnum, "ch");
start = iPos * 7;
end = start + 7;
a = 0;
if(start >= pnum) start = iPos = g_iMenuPos[id] = 0;
if(end > pnum) end = pnum;
iLen = formatex(sMenu, charsmax(sMenu), "\w[\rVoice Menu\w] Выберите игрока\w\R%d/%d^n^n", iPos + 1, (pnum / 7 + ((pnum % 7) ? 1 : 0))), iKeys = MENU_KEY_0|MENU_KEY_8;
#if defined SUPERADMIN
new bool:superadmin = bool:(get_user_flags(id) & ADMIN_RCON);
#endif
for(new i = start; i < end; i++)
{
get_user_name(players[id][i], sName, charsmax(sName));
if(id == players[id][i])
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(players[id][i]) & ADMIN_IMMUNITY)
#else
else if(get_user_flags(players[id][i]) & ADMIN_IMMUNITY)
#endif
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \w[\rImm\w]^n", ++a, sName);
else
{
iKeys |= (1 << a++);
if(GetBit(g_bitBlockChats, players[id][i]))
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \w%s \w[\yUngag\w]^n", a, sName);
else
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \w%s^n", a, sName);
}
}
if(!g_BlockTimes[g_iMenuSelectBlock[id]])
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_iMenuSelectBlock[id]]);
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 ? "Назад" : "Выход");
return show_menu(id, iKeys, sMenu, -1, "AmxGag Menu");
}
public GagMenuHandler(id, iKey)
{
switch(iKey)
{
case 7:
{
if(++g_iMenuSelectBlock[id] > charsmax(g_BlockTimes))
g_iMenuSelectBlock[id] = 0;
ShowGagMenu(id, g_iMenuPos[id]);
}
case 8: ShowGagMenu(id, ++g_iMenuPos[id]);
case 9: if(g_iMenuPos[id]) ShowGagMenu(id, --g_iMenuPos[id]);
default:
{
new sNameAdmin[32], sNamePlayer[32];
new iPlayer = players[id][g_iMenuPos[id] * 7 + iKey];
get_user_name(id, sNameAdmin, charsmax(sNameAdmin));
get_user_name(iPlayer, sNamePlayer, charsmax(sNamePlayer));
if(GetBit(g_bitBlockChats, iPlayer))
{
UserBlock(iPlayer, 0);
ChatColor(0, iPlayer, MSG_CHAT_UNBLOCK_ALL, PREFIX, sNamePlayer, sNameAdmin);
ChatColor(iPlayer, 0, MSG_CHAT_UNBLOCK_PL, PREFIX, sNamePlayer, sNameAdmin);
}
else
{
UserBlock(iPlayer, 1, g_BlockTimes[g_iMenuSelectBlock[id]]);
new blocktimeinfo[32];
if(!g_BlockTimes[g_iMenuSelectBlock[id]])
formatex(blocktimeinfo, charsmax(blocktimeinfo), "навсегда");
else formatex(blocktimeinfo, charsmax(blocktimeinfo), "на %d минут", g_BlockTimes[g_iMenuSelectBlock[id]]);
ChatColor(0, iPlayer, MSG_CHAT_BLOCK_ALL, PREFIX, sNameAdmin, sNamePlayer, blocktimeinfo);
ChatColor(iPlayer, 0, MSG_CHAT_BLOCK_PL, PREFIX, sNamePlayer, sNameAdmin, blocktimeinfo);
}
ShowGagMenu(id, g_iMenuPos[id]);
}
}
return PLUGIN_HANDLED;
}
#if defined MUTEMENU
new g_iMuteList[33];
new plMute[33][32], plNum[33];
public ClCmdMuteMenu(id)
{
g_iMuteList[id] = 0;
ShowMuteMenu(id, 0);
return PLUGIN_HANDLED;
}
ShowMuteMenu(id, iPos)
{
new sMenu[512], iLen, iKeys, sName[32], a, start, end;
get_players(plMute[id], plNum[id], "ch");
start = iPos * 6;
end = start + 6;
a = 0;
if(start >= plNum[id]) start = iPos = g_iMuteList[id] = 0;
if(end > plNum[id]) end = plNum[id];
iLen = formatex(sMenu, charsmax(sMenu), "\w[\rMute Menu\w] Выберите игрока\w\R%d/%d^n^n", iPos + 1, (plNum[id] / 6 + ((plNum[id] % 6) ? 1 : 0))), iKeys = MENU_KEY_0|MENU_KEY_7|MENU_KEY_8;
for(new i = start; i < end; i++)
{
get_user_name(plMute[id][i], sName, charsmax(sName));
if(id == plMute[id][i])
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\r%d. \d%s \w[\rЭто Вы\w]^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][plMute[id][i]] ? "\d[\rMuted\d]" : "");
}
}
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "^n\y7. \rЗаглушить всех^n");
iLen += formatex(sMenu[iLen], charsmax(sMenu) - iLen, "\y8. \rСнять Mute со всех^n^n");
if(end != plNum[id])
{
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 ? "Назад" : "Выход");
return show_menu(id, iKeys, sMenu, -1, "Mute Menu");
}
public MuteMenuHandler(id, iKey)
{
switch(iKey)
{
case 6:
{
for(new i; i < plNum[id]; i++)
if(id != plMute[id][i])
g_iMutePlayer[id][plMute[id][i]] = 1;
ChatColor(id, 0, MSG_MUTE_ALL_PLAYERS, PREFIX);
}
case 7:
{
for(new i; i < plNum[id]; i++)
if(id != plMute[id][i])
g_iMutePlayer[id][plMute[id][i]] = 0;
ChatColor(id, 0, MSG_UNMUTE_ALL_PLAYERS, PREFIX);
}
case 8: ShowMuteMenu(id, ++g_iMuteList[id]);
case 9: if(g_iMuteList[id]) ShowMuteMenu(id, --g_iMuteList[id]);
default:
{
new sNamePlayer[32];
new iPlayer = plMute[id][g_iMuteList[id] * 6 + iKey];
get_user_name(iPlayer, sNamePlayer, charsmax(sNamePlayer));
if(g_iMutePlayer[id][iPlayer])
ChatColor(id, 0, MSG_UNMUTE_PLAYER, PREFIX, sNamePlayer);
else ChatColor(id, 0, MSG_MUTE_PLAYER, PREFIX, sNamePlayer);
g_iMutePlayer[id][iPlayer] = g_iMutePlayer[id][iPlayer] ? 0 : 1;
ShowMuteMenu(id, g_iMuteList[id]);
}
}
return PLUGIN_HANDLED;
}
#endif
UserBlock(id, block, btime = 0)
{
switch(block)
{
case 0: IsUserBlocked(id, g_aLoadedData[id][IP], g_aLoadedData[id][STEAMID], 1);
case 1:
{
g_aLoadedData[id][BLOCKTIME] = !btime ? 0 : get_systime() + btime * 60;
ArrayPushArray(g_aUsersBlocked, g_aLoadedData[id]);
SetBit(g_bitBlockChats, id);
#if defined USE_API_VTC
VTC_MuteClient(id);
#endif
client_cmd(id, "-voicerecord"); // типа отключаем войс, ога
}
}
}
IsUserBlocked(id, const Ip[], const SteamID[], UnBlock = 0)
{
static i, ArraySizee, sys; sys = get_systime();
ArraySizee = ArraySize(g_aUsersBlocked);
for(i = 0; i < ArraySizee; i++)
{
ArrayGetArray(g_aUsersBlocked, i, g_arrData);
if(!strcmp(g_arrData[IP], Ip) || !strcmp(g_arrData[STEAMID], SteamID))
{
if(!UnBlock && (!g_arrData[BLOCKTIME] || g_arrData[BLOCKTIME] > sys))
{
g_aLoadedData[id][BLOCKTIME] = g_arrData[BLOCKTIME];
return i;
}
else
{
ArrayDeleteItem(g_aUsersBlocked, i);
ResetBit(g_bitBlockChats, id);
#if defined USE_API_VTC
VTC_UnmuteClient(id);
#endif
}
break;
}
}
return -1;
}
public plugin_end()
{
if(file_exists(STORAGE))
unlink(STORAGE);
new ArraySizee, fp = fopen(STORAGE, "w+");
if(!fprintf(fp, "; File generated by AMX Gag. [ neygomon | https://neugomon.ru ]^n^n"))
{
new err[128]; formatex(err, charsmax(err), "Plugin not write file %s! Users not saved!", STORAGE);
set_fail_state(err);
}
ArraySizee = ArraySize(g_aUsersBlocked);
for(new i; i < ArraySizee; i++)
{
ArrayGetArray(g_aUsersBlocked, i, g_arrData);
fprintf(fp, "^"%s^" ^"%s^" ^"%d^"^n", g_arrData[IP], g_arrData[STEAMID], g_arrData[BLOCKTIME]);
}
if(ArraySizee) log_amx("Successfully saved %d items in %s :)", ArraySizee, STORAGE);
fclose(fp);
ArrayDestroy(g_aUsersBlocked);
TrieDestroy(g_tAllowCmds);
}
stock ChatColor(id, id2, const szMessage[], any:...)
{
static szMsg[190];
vformat(szMsg, charsmax(szMsg), szMessage, 4);
if(id)
{
if(!is_user_connected(id)) return;
pnum = 1;
pl[0] = id;
}
else get_players(pl, pnum, "c");
for(new i; i < pnum; i++)
{
if(id2 == pl[i]) continue;
message_begin(MSG_ONE_UNRELIABLE, 76, .player = pl[i]);
write_byte(pl[i]);
write_string(szMsg);
message_end();
}
}
Всем привет народ подскажите. Ставлю гаг на игрока он не может говорить и в чате пишет что у него чат заблокирован, но если он что то напишет то видно в чате что он пишет. Помогите исправить. Было всё нормально что то слетело не могу понять что.
В этой теме было размещено решение! Перейти к решению.
Вложения
-
17.2 KB Просмотры: 196