neygomon Advanced Gag 1.9.0

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
145
Реакции
8
Предупреждения
1
Ошибка
unknown command
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263
Билд
Build date: 03:13:55 Oct 25 2021 (2753)
ReGamedll
ReGameDLL version: 5.21.0.540-dev
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.so          v0.1.92d         ini  Start Never
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 3] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 4] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 6] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[ 7] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[ 8] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[ 9] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.21.0.252-dev pl2 ANY Never
[13] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl2 ANY Never
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
[15] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl2 ANY ANY
Список плагинов
[  1] admin_loader            0.5.7       kanagava          admin_loader-05  running  
[ 2] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 3] WebHS 0.1 kanagava fb_web_online.a running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 6] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 7] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 8] Teleport Menu 1.9.0.5263 AMXX Dev Team telemenu.amxx running
[ 9] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 10] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 11] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 12] Scrolling Message 1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 13] Info. Messages 1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 14] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 15] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 16] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 17] CS Misc. Stats 1.9.0.5263 AMXX Dev Team miscstats.amxx running
[ 18] CS Stats Logging 1.9.0.5263 AMXX Dev Team stats_logging.a running
[ 19] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 20] Simple Damager 2.1.0 fl0wer simple_damager. running
[ 21] [ReAPI] Hint blocker 0.1.0 F@tn0M reapi_hint_bloc running
[ 22] Advanced Ultimate Weap 0.0.3-Alph steelzzz advanced_ultima running
[ 23] [Customizable] AmxModM 0.0.5 Albertio amxmodmenu.amxx running
[ 24] Ping Control 1.31 vanywa lox ebani Ping_Control.am running
[ 25] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 26] GameName 1.0 Lonkura GameName.amxx running
[ 27] Mode 2x2 2.5re s1lent mode.amxx running
[ 28] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 29] Admin Spectator ESP 1.3 KoST admin_spec_esp. running
[ 30] Admin Free Look 2.0 Jim admin_freelook. running
[ 31] Auto recording demo 2.0 IzI | Bonaqua (R amx_autodemorec running
[ 32] unknown unknown unknown resetscore.amxx running
[ 33] Admin Prefixes 3.0 m0skVi4a ;] AdminPrefixes.a running
[ 34] Loading Sound 1.0 Amxx User loadingsound.am running
[ 35] Nade Health 1.2 medusa NadeHealth.amxx running
[ 36] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 37] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 38] [ReAPI] Custom Models 1.6.1 neugomon custom_models.a running
[ 39] [ReAPI] AWPoff 1.3 PAffAEJIkA :3 awp_off.amxx running
[ 40] DM BlockRadio 1.0 NEXT block_sound.amx running
[ 41] Menu 1.0 WaT_1 menu.amxx running
[ 42] HeadShot Blood 1.1 tuty hs_blood.amxx running
[ 43] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 44] Team Balance Control 1.3.9 gyxoBka TeamBalanceCont running
[ 45] Stop the Bastards 1.7.0 F@nt0M stop_the_bastar running
[ 46] Print VIP Connection 0.0.6 Albertio print_vip_conne running
[ 47] StatsX (MastaMan Editi 1.8.2 AMXX Dev Team & statsx_shell.am running
[ 48] Advanced Experience Sy 0.5 Vega serfreeman1337 aes_main.amxx running
[ 49] AES: CStrike Addon 0.5 Vega serfreeman1337 aes_exp_cstrike running
[ 50] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 51] AES: Admin Tools 0.5 Vega serfreeman1337 aes_exp_editor. running
[ 52] AES: Bonus System 0.5 Vega serfreeman1337 aes_bonus_syste running
[ 53] AES: Bonus CSTRIKE 0.5 Vega serfreeman1337 aes_bonus_cstri running
Автор плагина
neygomon
Версия плагина
1.9.0
Исходный код
// *************************************************************************************//
// Плагин загружен с www.neugomon.ru //
// Автор: Neygomon [ https://neugomon.ru/members/1/ ] //
// Официальная тема поддержки: https://neugomon.ru/threads/91/ //
// При копировании материала ссылка на сайт www.neugomon.ru ОБЯЗАТЕЛЬНА! //
// *************************************************************************************//

#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 "AMX Gag" // Префикс в чате
#define SUPERADMIN ADMIN_RCON // Админ с флагом L может гагать других админов с иммунитетом

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

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!"
#define MSG_CHAT_IS_BLOCKED "^1[^4%s^1] ^4Уважаемый ^3%s^4, Ваш чат ^3заблокирован^4!"
#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"
#define MSG_CHAT_BLOCK_PL "^1[^4%s^1] ^4Уважаемый ^3%s^4, администратор ^3%s ^4заблокировал Вам чат ^1%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."

/* Технические данные */
#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.0"
register_plugin("Advanced Gag", VERSION, "neygomon");
register_cvar("adv_gag", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
#if defined _reapi_included
if(has_vtc())
{
register_clcmd("amx_gagmenu", "ClCmdGagMenu");
}
#if !defined MUTEMENU
else set_fail_state("Needed meta plugin VTC [https://neugomon.ru/threads/257/]");
#endif
#else
register_clcmd("amx_gagmenu", "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("AdvGag 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[\rAMX Gag\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, "AdvGag 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), "на %d минут", 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);
}
}
}
}
скачал плагин - https://dev-cs.ru/resources/226/ установил
в консоли сервера отображается , работает .
А вот функции свои не выполняет . А именно при вводе amx_gagmenu ничего не происходит "unknown command"
31 Авг 2022
Чтобы плагин работал корректно VoiceTranscoderпропишите в meta liste выше AMXMODX это сделал !
 
В этой теме было размещено решение! Перейти к решению.

Вложения

Сообщения
145
Реакции
8
Предупреждения
1
@Алексеич,спасибо , забрал )
 
Статус
В этой теме нельзя размещать новые ответы.

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

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