- Ошибка
-
Не открывается gagmenu при вводе команды 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
Build date: 17:31:06 Jun 5 2019 (1880)
Build from: https://github.com/dreamstalker/rehlds/commit/0c8d3d7
- ReGamedll
-
ReGameDLL version: 5.9.0.362-dev
Build date: 20:19:32 Jun 21 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/b669a39
- Версия 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
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.133 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5249 ini Start ANY
[ 5] Revoice RUN - revoice_mm_i386.so v0.1.0.32 ini Start Never
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[ 8] ReAPI RUN - reapi_amxx_i386.so v5.9.0.171-dev pl4 ANY Never
[ 9] Engine RUN - engine_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[11] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[13] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[14] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5249 pl4 ANY ANY
[16] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[17] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[18] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[19] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[20] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
20 plugins, 20 running
- Список плагинов
-
admin_loader 0.5.5 kanagava admin_loader-05 running
WebHS 0.1 kanagava fb_web_online.a running
FreshBans 1.4.2b kanagava fresh_bans_142_ running
fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
Admin Commands 1.9.0.5249 AMXX Dev Team admincmd.amxx running
Admin Help 1.9.0.5249 AMXX Dev Team adminhelp.amxx running
Slots Reservation 1.9.0.5249 AMXX Dev Team adminslots.amxx running
Multi-Lingual Sys 1.9.0.5249 AMXX Dev Team multilingual.am running
Menus Front-End 1.9.0.5249 AMXX Dev Team menufront.amxx running
Commands Menu 1.9.0.5249 AMXX Dev Team cmdmenu.amxx running
Players Menu 1.9.0.5249 AMXX Dev Team plmenu.amxx running
Maps Menu 1.9.0.5249 AMXX Dev Team mapsmenu.amxx running
Plugin Menu 1.9.0.5249 AMXX Dev Team pluginmenu.amxx running
Reklama 09.07.2019 mx?! reklama.amxx running
Admin Chat 1.9.0.5249 AMXX Dev Team adminchat.amxx running
Anti Flood 1.9.0.5249 AMXX Dev Team antiflood.amxx running
Scrolling Message 1.9.0.5249 AMXX Dev Team scrollmsg.amxx running
Info. Messages 1.9.0.5249 AMXX Dev Team imessage.amxx running
Admin Votes 1.9.0.5249 AMXX Dev Team adminvote.amxx running
TimeLeft 1.9.0.5249 AMXX Dev Team timeleft.amxx running
Pause Plugins 1.9.0.5249 AMXX Dev Team pausecfg.amxx running
Stats Configurati 1.9.0.5249 AMXX Dev Team statscfg.amxx running
StatsX 1.9.0.5249 AMXX Dev Team statsx.amxx running
CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ReAPI] Custom Mo 1.6.1 neugomon custom_models.a running
Spectator Bots 2.1 SISA s_b.amxx running
Micro Army Rank S 1.29Hz_p1 Ge3eR mars.amxx running
unknown unknown unknown ExCLuSiVe_CSDM. running
Connect Info 1.0 Hypa_[KZ] connect_info.am running
Parachute 1.1 Random1, 93()|29 sub_parachute.a running
AFK Control ReNew 1.2(a) neygomon afk_control.amx running
Advanced Kill Ass 0.9 Spection next21_kill_ass running
Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
Show Damage 1.0 neygomon damager.amxx running
Screen Fade [True 1.0 Leo_[BH] screen_fade_fla running
AntiFlash FINAL 5.0 Leo_[BH] antiflash5.amxx running
Ultimate Gore 1.6 JTP10181 amx_gore_ultima running
Reset Score and S 1.0 Silence NewResetScore.a running
RE Vampire 1.0.7 MakapoH, AcE, RE re_vampire.amxx running
Voteban CSR 0.8.5beta Leo_[BH] csr_voteban.amx running
Demo Recorder 1.6 Sho0ter demorecorder.am running
Time Lights 1.1 Leo_[BH] time_light.amxx running
Simple Grenade Tr 1.0 seroff granade_trail.a running
PLUGIN VERSION AUTHOR hidetimer.amxx running
Weapon Skin Syste 0.7.0-55 Mistrick weapon_skin_sys running
[ReAMX] BackWeapo 17.08.11 SKAJIbnEJIb & ho backweapons_rbs running
NoRound Balancer 1.3 neygomon noround_balance running
unknown unknown unknown menuSystem.amxx running
Spec Switch 0.0.3 many spec_switch_new running
Kills Rarity 0.0.1 wopox1337 KillsRarity.amx running
InName Combo Kill 0.0.2 wopox1337 InName_Combo_Ki running
Grab 3.0 DEPO grab.amxx running
Advanced Gag 1.9.0 neygomon amx_gag.amxx running
HUD Menu 2.0 {DePo} HUD_Menu.amxx running
Bullet Whizz 1.4 Cheap_Suit Bullet_Whizz.am running
Lite Admin ESP 1.0 neygomon admin_esp.amxx running
Colored Spawn 1.2.2 fezh colored_spawn.a running
Lite Translit 2.8 neygomon lite_translit.a running
Map Manager: Sche 0.1.3 Mistrick map_manager_sch running
Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
Map Manager: Nomi 0.1.2 Mistrick map_manager_nom running
Map Manager: Bloc 0.0.3 Mistrick map_manager_blo running
Map Manager: Onli 0.0.2 Mistrick map_manager_onl running
Map Manager: Effe 0.0.8 Mistrick map_manager_eff running
Map Manager: Info 0.0.5 Mistrick map_manager_inf running
- Автор плагина
- neygomon
- Версия плагина
- -
- Исходный код
-
// *************************************************************************************//
// Плагин загружен с 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);
}
}
}
}
Не работает gagmenu при вводе команды amx_gagmenu. Помогите. В заранее спасибо.
В этой теме было размещено решение! Перейти к решению.