Проблема с cs_chatvoice_manager.amxx

Сообщения
11
Реакции
0
Ошибка
функционал плагина
ОС
Linux
Amx Mod X
1.9.0.5263
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev-mpatch
Build date: 18:13:20 Sep 30 2019 (1997)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.12.0.425-dev
Build date: 08:48:23 Nov 2 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/fd06d65
Версия 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
Список метамодулей
[ 1] SafeNameAndChat  RUN   -    SafeNameAndChat.so          v1.1             ini  ANY   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c 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] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC4 ini ANY ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 8] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 9] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[14] ReAPI RUN - reapi_amxx_i386.so v5.11.0.190-dev pl7 ANY Never
[15] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[16] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
[17] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl7 ANY ANY
Список плагинов
[  1] FreshBans               1.4.3b      kanagava          fresh_bans_143_  running  
[ 2] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5263 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5263 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5263 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.5 neugomon menufront_end.a running
[ 7] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 11] [CS] Chat & Voice Mana 0.3 81x08 cs_chatvoice_ma running
[ 12] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 13] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 14] Scrolling Message 1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 15] Info. Messages 1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 16] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 17] NextMap 1.9.0.5263 AMXX Dev Team nextmap.amxx running
[ 18] Nextmap Chooser 1.9.0.5263 AMXX Dev Team mapchooser.amxx running
[ 19] TimeLeft 1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 20] Pause Plugins 1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 21] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 22] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 23] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 24] CSXSQL: Onlinetime Awa 0.2 serfreeman1337 csstatsx_playti running
[ 25] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 26] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 27] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 28] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 29] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 30] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 31] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 32] StatsX 1.9.0.5263 AMXX Dev Team statsx.amxx running
[ 33] Admin Loader 3.5 neygomon admin_loader_3. running
[ 34] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 35] WebHS 0.1 kanagava fb_web_online.a running
[ 36] fb_forwards 0.1.5 Kanagava & Realu fb_forwards.amx running
[ 37] Map Manager: Core 3.0.4 Mistrick map_manager_cor running
[ 38] Map Manager: Scheduler 0.1.2 Mistrick map_manager_sch running
[ 39] Map Manager: Advanced 0.0.5 Mistrick map_manager_adv running
[ 40] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 41] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 42] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 43] Map Manager: Nominatio 0.1.0 Mistrick map_manager_nom running
[ 44] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 45] Map Manager: Rtv 0.1.0 Mistrick map_manager_rtv running
[ 46] Mode 2x2 2.5re s1lent mode.amxx running
[ 47] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 48] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 49] Advanced Client Checke 0.3.6 Mistrick cmdchecker.amxx running
[ 50] Forbidden Names 0.0.3 Vaqtincha Forbidden_Names running
[ 51] Lite VIP System 1.5 neygomon lite_vip.amxx running
[ 52] Spec Money Save 0.2 F@nt0M spec_money_save running
[ 53] [ReAPI] Round Balancer 1.1 neygomon round_balancer. running
[ 54] FM ResetScore 0.1 neygomon fm_rs.amxx running
[ 55] AWPoff 1.7 PAffAEJIkA :3 hlds_awp_off.am running
[ 56] Parachute 1.1 maeStro | neygom parachut.amxx running
[ 57] Damager Advanced 1.1.2 Radius (based on damager_advance running
[ 58] [ReAPI] No Team Flash 0.0.3 Vaqtincha no_team_flash.a running
[ 59] Lite Admin ESP 1.1 neygomon, AcE admin_esp.amxx running
[ 60] Style C4 Timer 3.0 OciXCrom crx_c4timer.amx running
[ 61] Hide Slash 1.0 HZ hide_slash.amxx running
[ 62] GHW Connect Messages 1.1 GHW_Chronic GHW_connect.amx running
[ 63] Lite Vampire 1.2 neygomon lite_vampire.am running
[ 64] Auto Game Restart with 1.0 AbeX auto_rr.amxx running
[ 65] Lite Kill Assist 1.17 neygomon lite_kill_assis running
Автор плагина
81x08
Версия плагина
0.3
Исходный код
/******************************
* .:: Credit's ::.
* 81x08
* wopox1337
*
* .:: Support forum::.
* http://dev-cs.ru
* Copyright © 2016
*
******************************/
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#if AMXX_VERSION_NUM < 183
#define MAX_PLAYERS 32
#include <colorchat>

#define ColorChat client_print_color
#define print_team_default DontChange
#define print_team_grey Grey
#define print_team_red Red
#define print_team_blue Blue
#endif

#pragma semicolon 1

#define PLUGIN_NAME "[CS] Chat & Voice Manager"
#define PLUGIN_VERS "0.3"
#define PLUGIN_AUTH "81x08"

#define AMXX_1.8.3

#define SetBit(%0,%1) ((%0) |= (1 << (%1)))
#define ClearBit(%0,%1) ((%0) &= ~(1 << (%1)))
#define IsSetBit(%0,%1) ((%0) & (1 << (%1)))
#define IsNotSetBit(%0,%1) (~(%0) & (1 << (%1)))


#define CVM_CHAT_PREFIX "[CVM]"

#define CVM_MODE_AES /* AES by serfreeman1337 */
#define CVM_MODE_CSSTATS_SQL /* CSSTATS SQL by serfreeman1337 */

#define CVM_HEAR_ENEMY /* Ñëûøèò ëè èãðîê ïðîòèâíèêà */
#define CVM_HEAR_DEATH /* Ñëûøèò ëè æèâîé èãðîê ì¸ðòâîãî èãðîêà */
#define CVM_DEATH_HEAR_LIVE /* Ñëûøèò ëè ì¸ðòâûé èãðîê æèâîãî èãðîêà */
#define CVM_HIDE_IMMUNITY /* Ñêðûâàòü ëè èãðîêà ó êîòîðîãî èììóíèòåò èëè àäìèíêà èç ìåíþ Gag è VoteGag */

#define CVM_GAG_ACCESS "abc" /* Ôëàãè äëÿ îòêðûòèÿ Gag ìåíþ */
#define CVM_IMMUNITY_FLAGS "a" /* Ôëàãè èììóíèòåòà, îò áëîêèðîâêè ÷àòà\ãîëîñà */
#define CVM_FLAGS_LISTEN_ALL "b" /* Ôëàãè äëÿ ïðîñëóøèâàíèÿ âñåõ èãðîêîâ (íåçàâèñèìî îò íàñòðîåê) */

#define CVM_SHOW_TEXT_GAG 0 /* [0 - ALL | 1 - ADMIN & PLAYER] Êîìó ïîêàçûâàòü ñîîáùåíèå î ãàãå */

#define CVM_TIME_VOTE_GAG 15 /* Âðåìÿ â ñåêóíäàõ, ñêîëüêî äëèòñÿ ãîëîñîâàíèå VoteGag */
#define CVM_NEXT_VOTE_GAG 30 /* Âðåìÿ â ñåêóíäàõ, äî âîçìîæíîãî ñëåäóþùåãî VoteGag */

#if defined CVM_MODE_AES
#define CVM_AES_RANK_USE_CHAT 0 /* Ðàíã, êîòîðûé äîëæåí èìåòü èãðîê, ÷òîáû èñïîëüçîâàòü ÷àò */
#define CVM_AES_RANK_USE_VOICE 0 /* Ðàíã, êîòîðûé äîëæåí èìåòü èãðîê, ÷òîáû èñïîëüçîâàòü ìèêðîôîí */

new g_szRankNameChat[40];

new gp_iRank[MAX_PLAYERS + 1 char];

native aes_get_player_stats(const pId, const iStats[4]);
native aes_get_level_name(const iLevel, const szRankName[], const iLen, const iIdLang = LANG_SERVER);
#endif

#if defined CVM_MODE_CSSTATS_SQL
#define CVM_CSSTATS_FRAG_USE_CHAT 0 /* Êîë-âî óáèéñòâ, äëÿ èñïîëüçîâàíèÿ ÷àòà */
#define CVM_CSSTATS_FRAG_USE_VOICE 0 /* Êîë-âî óáèéñòâ, äëÿ èñïîëüçîâàíèÿ ãîëîñîâîãî ÷àòà */

new gp_iFrags[MAX_PLAYERS + 1 char];

native get_user_stats_sql(const pId, const iStats[8], const iBodyHits[8]);
#endif

enum {
TEAM_UNNASIGNED = 0,

TEAM_T,
TEAM_CT,
TEAM_SPECATOR
};

enum _: ENUM_DATA_PL_VOTE_GAG {
PL_VOTE_GAG_ID,
PL_VOTE_GAG_TYPE,
PL_VOTE_GAG_TIME
};

enum _: ENUM_DATA_GAG_TYPE {
GAG_TYPE_NONE,

GAG_TYPE_CHAT,
GAG_TYPE_VOICE,
GAG_TYPE_COMMAND_CHAT,
GAG_TYPE_ALL
};

enum _: ENUM_DATA_PLAYER_GAG {
PL_GAG_TYPE,
PL_GAG_TIME
};

enum _: ENUM_DATA_BITS {
BIT_NULL,

BIT_ALIVE,
BIT_ACCESS,
BIT_GAGGED,
BIT_MUTTED[MAX_PLAYERS + 1 char],
BIT_IMMUNITY,
BIT_CONNECTED,
BIT_LISTEN_ALL,

BIT_MAX
};

new const g_iGagTimes[] = {5, 10, 30, 60, 120, 180};

new const g_szGagTypes[][] = {'^0', "Chat", "Voice", "Team chat", "ALL"};

new g_iMaxPlayers;

new g_iVoteTotalNo,
g_iVoteTotalYes,
g_iVotePlayerGag[ENUM_DATA_PL_VOTE_GAG];

new gp_iMenuTarget[MAX_PLAYERS + 1 char],
gp_iMenuPlayers[MAX_PLAYERS + 1 char][MAX_PLAYERS],
gp_iMenuPosition[MAX_PLAYERS + 1 char];

new gp_iBit[ENUM_DATA_BITS],
gp_iGag[MAX_PLAYERS + 1 char][ENUM_DATA_PLAYER_GAG],
gp_iTeam[MAX_PLAYERS + 1 char];

new gp_szIP[MAX_PLAYERS + 1 char][16];

new Trie: g_tPlayerGag;

/*================================================================================
[PLUGIN]
=================================================================================*/
public plugin_init() {
/* [PLUGIN] */
register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH);

/* [CLCMD] */
register_clcmd("say", "ClCmd_HookSay");
register_clcmd("say_team", "ClCmd_HookSayTeam");

register_clcmd("cvm_gag", "ClCmd_Gag");
register_clcmd("say /gag", "ClCmd_Gag");

register_clcmd("say /mute", "ClCmd_Mute");

register_clcmd("say /vg", "ClCmd_VoteGag");
register_clcmd("say /votegag", "ClCmd_VoteGag");

/* [MENUCMD] */
register_menucmd(register_menuid("Show_GagMenu"), 1023, "Handler_GagMenu");
register_menucmd(register_menuid("Show_MuteMenu"), 1023, "Handler_MuteMenu");
register_menucmd(register_menuid("Show_ChooseGagType"), 1023, "Handler_ChooseGagType");
register_menucmd(register_menuid("Show_ChooseGagTime"), 1023, "Handler_ChooseGagTime");

register_menucmd(register_menuid("Show_VoteGagMenu"), 1023, "Handler_VoteGagMenu");
register_menucmd(register_menuid("Show_ChooseVoteGagType"), 1023, "Handler_ChooseVoteGagType");
register_menucmd(register_menuid("Show_ChooseVoteGagTime"), 1023, "Handler_ChooseVoteGagTime");
register_menucmd(register_menuid("Show_ChooseVoteGagAnswer"), 1023, "Handler_ChooseVoteGagAnswer");

/* [EVENT] */
register_event("TeamInfo", "EventHook_TeamInfo", "a");

#if defined CVM_MODE_AES || defined CVM_MODE_CSSTATS_SQL
/* [LOGEVENT] */
register_logevent("LogEventHook_RoundStart", 2, "1=Round_Start");
#endif

/* [FAKEMETA] */
register_forward(FM_Voice_SetClientListening, "FMHook_VoiceClientListening_Pre", false);

/* [HAMSANDWICH] */
RegisterHam(Ham_Spawn, "player", "HamHook_Player_Spawn_Post", true);
RegisterHam(Ham_Killed, "player", "HamHook_Player_Killed_Post", true);


/* [OTHER] */
g_iMaxPlayers = get_maxplayers();

g_tPlayerGag = TrieCreate();
}

public plugin_end()
TrieDestroy(g_tPlayerGag);

public plugin_natives()
set_native_filter("native_filter");

public native_filter(const szName[], const iIndex, const iTrap)
return iTrap ? PLUGIN_CONTINUE : PLUGIN_HANDLED;

/*================================================================================
[CLIENT]
=================================================================================*/
public client_putinserver(pId) {
if(is_user_bot(pId) || is_user_hltv(pId))
return PLUGIN_HANDLED;

SetBit(gp_iBit[BIT_CONNECTED], pId);

new iFlags = get_user_flags(pId);

if(iFlags & read_flags(CVM_GAG_ACCESS)) SetBit(gp_iBit[BIT_ACCESS], pId);
if(iFlags & read_flags(CVM_IMMUNITY_FLAGS)) SetBit(gp_iBit[BIT_IMMUNITY], pId);
if(iFlags & read_flags(CVM_FLAGS_LISTEN_ALL)) SetBit(gp_iBit[BIT_LISTEN_ALL], pId);

get_user_ip(pId, gp_szIP[pId], charsmax(gp_szIP[]), true);

new tData[ENUM_DATA_PLAYER_GAG];
if(TrieGetArray(g_tPlayerGag, gp_szIP[pId], tData, sizeof(tData))) {
if(tData[PL_GAG_TIME] > get_systime()) {
gp_iGag[pId][PL_GAG_TYPE] = tData[PL_GAG_TYPE];
gp_iGag[pId][PL_GAG_TIME] = tData[PL_GAG_TIME];

SetBit(gp_iBit[BIT_GAGGED], pId);
} else UnGag(pId);
}

#if defined CVM_MODE_AES || defined CVM_MODE_CSSTATS_SQL
GetPlayerStats(pId);
#endif

return PLUGIN_CONTINUE;
}

public client_disconnect(pId) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], pId))
return PLUGIN_HANDLED;

for(new iCount = BIT_NULL; iCount < BIT_MAX; iCount++)
ClearBit(gp_iBit[iCount], pId);

gp_iTeam[pId] = TEAM_UNNASIGNED;

gp_iGag[pId][PL_GAG_TYPE] = 0;
gp_iGag[pId][PL_GAG_TIME] = 0;

gp_szIP[pId] = "";

return PLUGIN_CONTINUE;
}

/*================================================================================
[CLCMD]
=================================================================================*/
public ClCmd_HookSay(const pId) return HookSay(pId);
public ClCmd_HookSayTeam(const pId) return HookSay(pId, true);

HookSay(const pId, const bool: bTeam = false) {
if(IsSetBit(gp_iBit[BIT_IMMUNITY], pId))
return PLUGIN_CONTINUE;

if(IsSetBit(gp_iBit[BIT_GAGGED], pId) && (gp_iGag[pId][PL_GAG_TYPE] == (bTeam ? GAG_TYPE_COMMAND_CHAT : GAG_TYPE_CHAT) || gp_iGag[pId][PL_GAG_TYPE] == GAG_TYPE_ALL)) {
new iGagTimeLeft = gp_iGag[pId][PL_GAG_TIME] - get_systime();
if(iGagTimeLeft > 0) {
client_print_color(pId, print_team_default, "^3%s ^1Èçâèíèòå, íî ó Âàñ ^4^"Gag^" ^1íà ^3%s ^1÷àò. Âðåìåíè îñòàëîñü: ^4%s", CVM_CHAT_PREFIX, bTeam ? "êîìàíäíûé" : "îáùèé", UTIL_FixTime(iGagTimeLeft));
return PLUGIN_HANDLED;
} else UnGag(pId);
}

#if defined CVM_MODE_CSSTATS_SQL
if(gp_iFrags[pId] < CVM_CSSTATS_FRAG_USE_CHAT) {
client_print_color(pId, print_team_default, "^3%s ^1Äëÿ äîïóñêà ê ÷àòó, Âàì íóæíî íàáðàòü ^3%d ^1óáèéñòâ.", CVM_CHAT_PREFIX, CVM_CSSTATS_FRAG_USE_CHAT);
return PLUGIN_HANDLED;
}
#endif

#if defined CVM_MODE_AES
if(gp_iRank[pId] < CVM_AES_RANK_USE_CHAT) {
if(g_szRankNameChat[0] == '^0')
aes_get_level_name(CVM_AES_RANK_USE_CHAT, g_szRankNameChat, charsmax(g_szRankNameChat));

client_print_color(pId, print_team_default, "^3%s ^1Äëÿ äîïóñêà ê ÷àòó, ïîëó÷èòå çâàíèå ^3^"%s^"", CVM_CHAT_PREFIX, g_szRankNameChat);
return PLUGIN_HANDLED;
}
#endif

return PLUGIN_CONTINUE;
}

public ClCmd_Gag(const pId)
return IsSetBit(gp_iBit[BIT_ACCESS], pId) ? Show_GagMenu(pId, gp_iMenuPosition[pId] = 0) : PLUGIN_HANDLED;

public ClCmd_Mute(const pId)
return Show_MuteMenu(pId, gp_iMenuPosition[pId] = 0);

public ClCmd_VoteGag(const pId) {
new iSysTime = get_systime(); static iNextTime;

if(iNextTime > iSysTime) {
client_print_color(pId, print_team_default, "^3%s ^1Çàïóñê íîâîãî ãîëîñîâàíèÿ âîçìîæíî ÷åðåç ^4%d ^1ñåêóíä", CVM_CHAT_PREFIX, iNextTime - iSysTime);
return PLUGIN_HANDLED;
}

iNextTime = iSysTime + CVM_NEXT_VOTE_GAG;
return Show_VoteGagMenu(pId, gp_iMenuPosition[pId] = 0);
}

/*================================================================================
[MENUCMD]
=================================================================================*/

/* [GAG] */
Show_GagMenu(const pId, const iPos) {
if(iPos < 0)
return PLUGIN_HANDLED;

new iPlayersNum;
for(new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iIndex) || pId == iIndex)
continue;

#if defined CVM_HIDE_IMMUNITY
if(IsSetBit(gp_iBit[BIT_ACCESS], iIndex) || IsSetBit(gp_iBit[BIT_IMMUNITY], iIndex))
continue;
#endif

#if defined CVM_MODE_AES
if(gp_iRank[iIndex] < CVM_AES_RANK_USE_CHAT && gp_iRank[iIndex] < CVM_AES_RANK_USE_VOICE)
continue;
#endif

#if defined CVM_MODE_CSSTATS_SQL
if(gp_iFrags[iIndex] < CVM_CSSTATS_FRAG_USE_CHAT && gp_iFrags[iIndex] < CVM_CSSTATS_FRAG_USE_VOICE)
continue;
#endif

gp_iMenuPlayers[pId][iPlayersNum++] = iIndex;
}

new iStart = iPos * 8;
if(iStart > iPlayersNum) iStart = iPlayersNum;
iStart = iStart - (iStart % 8);
gp_iMenuPosition[pId] = iStart / 8;

new iEnd = iStart + 8;
if(iEnd > iPlayersNum) iEnd = iPlayersNum;

new szMenu[512], iLen, iPagesNum = (iPlayersNum / 8 + ((iPlayersNum % 8) ? 1 : 0));
switch(iPagesNum) {
case 0: {
client_print_color(pId, print_team_default, "^3%s ^1Íåòó ïîäõîäÿùèõ Èãðîêîâ.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}
default: iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM Gag] \rÂ\wûáåðèòå èãðîêà \d[%d|%d]^n^n", iPos + 1, iPagesNum);
}

new iItem, iIndex, iBitKeys = MENU_KEY_0, szName[32];
for(new i = iStart; i < iEnd; i++) {
iIndex = gp_iMenuPlayers[pId][i];
get_user_name(iIndex, szName, charsmax(szName));

#if !(defined CVM_HIDE_IMMUNITY)
if(IsSetBit(gp_iBit[BIT_ACCESS], iIndex) || IsSetBit(gp_iBit[BIT_IMMUNITY], iIndex)) {
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \d%s \r[ \dIMMUNITY \r]^n", ++iItem, szName);
continue;
}
#endif

iBitKeys |= (1 << iItem);

if(IsSetBit(gp_iBit[BIT_GAGGED], iIndex)) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s \r[ \yGAGGED \r]^n", ++iItem, szName);
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s^n", ++iItem, szName);
}

for(new i = iItem; i < 8; i++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

if(iEnd < iPlayersNum) {
iBitKeys |= MENU_KEY_9;
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r[9] \wÄàëåå^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");
} else formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_GagMenu");
}

public Handler_GagMenu(const pId, const iKey) {
switch(iKey) {
case 8: return Show_GagMenu(pId, ++gp_iMenuPosition[pId]);
case 9: return Show_GagMenu(pId, --gp_iMenuPosition[pId]);
default: {
new iPlayer = gp_iMenuTarget[pId] = gp_iMenuPlayers[pId][gp_iMenuPosition[pId] * 8 + iKey];

if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iPlayer)) {
client_print_color(pId, print_team_default, "^3%s ^1Ýòîò Èãðîê íå ïîäõîäèò.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}

if(IsSetBit(gp_iBit[BIT_GAGGED], iPlayer)) {
UnGag(iPlayer);

new szName[32];
get_user_name(iPlayer, szName, charsmax(szName));

switch(CVM_SHOW_TEXT_GAG) {
case 0: client_print_color(0, print_team_default, "^3%s ^1Èãðîêó ^4%s ^1ñíÿëè çàòû÷êó.", CVM_CHAT_PREFIX, szName);
case 1: {
client_print_color(pId, print_team_default, "^3%s ^1Âû èãðîêó ^4%s ^1ñíÿëè çàòû÷êó.", CVM_CHAT_PREFIX, szName);

get_user_name(pId, szName, charsmax(szName));
client_print_color(iPlayer, print_team_default, "^3%s ^1Àäìèí ^4%s ^1ñíÿë Âàì çàòû÷êó.", CVM_CHAT_PREFIX, szName);
}
}
} else return Show_ChooseGagType(pId);
}
}

return Show_GagMenu(pId, gp_iMenuPosition[pId]);
}

Show_ChooseGagType(const pId) {
static szMenu[160], iBitKeys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_9|MENU_KEY_0;
new iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM Gag] \rÂ\wûáåðèòå áëîêèðîâêó^n^n");

new iItem; static iSize = sizeof(g_szGagTypes);
for(iItem = 1; iItem < iSize; iItem++)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s^n", iItem, g_szGagTypes[iItem]);

for(new iCount = iItem - 1; iCount <= 8; iCount++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[9] \wÍàçàä^n");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[0] \wÂûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_ChooseGagType");
}

public Handler_ChooseGagType(const pId, const iKey) {
switch(iKey) {
case 0..3: {
gp_iGag[gp_iMenuTarget[pId]][PL_GAG_TYPE] = iKey + 1;
return Show_ChooseGagTime(pId);
}
case 8: {
gp_iMenuTarget[pId] = 0;
return Show_GagMenu(pId, gp_iMenuPosition[pId]);
}
}

return PLUGIN_HANDLED;
}

Show_ChooseGagTime(const pId) {
static szMenu[154], iBitKeys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_9|MENU_KEY_0;
new iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM Gag] \rÂ\wûáåðèòå âðåìÿ^n^n");

new iItem; static iSize = sizeof(g_iGagTimes);
for(iItem = 1; iItem <= iSize; iItem++)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%d^n", iItem, g_iGagTimes[iItem - 1]);

for(new iCount = iItem - 1; iCount <= 8; iCount++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[9] \wÍàçàä^n");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[0] \wÂûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_ChooseGagTime");
}

public Handler_ChooseGagTime(const pId, const iKey) {
switch(iKey) {
case 0..5: {
new iPlayer = gp_iMenuTarget[pId];

if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iPlayer)) {
client_print_color(pId, print_team_default, "^3%s ^1Ýòîò Èãðîê íå ïîäõîäèò.", CVM_CHAT_PREFIX);
return Show_GagMenu(pId, gp_iMenuPosition[pId]);
}

new tData[ENUM_DATA_PLAYER_GAG];

tData[PL_GAG_TYPE] = gp_iGag[iPlayer][PL_GAG_TYPE];
tData[PL_GAG_TIME] = gp_iGag[iPlayer][PL_GAG_TIME] = (get_systime() + (g_iGagTimes[iKey] * 60));

TrieSetArray(g_tPlayerGag, gp_szIP[iPlayer], tData, sizeof(tData));

SetBit(gp_iBit[BIT_GAGGED], iPlayer);

new szName[32];
get_user_name(iPlayer, szName, charsmax(szName));

switch(CVM_SHOW_TEXT_GAG) {
case 0: client_print_color(0, print_team_default, "^3%s ^1Èãðîêà ^4%s ^1çàòêíóëè íà ^4%d ^1ìèíóò. (%s)", CVM_CHAT_PREFIX, szName, g_iGagTimes[iKey], g_szGagTypes[gp_iGag[iPlayer][PL_GAG_TYPE]]);
case 1: {
client_print_color(pId, print_team_default, "^3%s ^1Âû èãðîêó ^4%s ^1äàëè çàòû÷êó íà ^4%d ^1ìèíóò. (%s)", CVM_CHAT_PREFIX, szName, g_iGagTimes[iKey], g_szGagTypes[gp_iGag[iPlayer][PL_GAG_TYPE]]);

get_user_name(pId, szName, charsmax(szName));
client_print_color(iPlayer, print_team_default, "^3%s ^1Àäìèí ^4%s âûäàë Âàì çàòû÷êó íà ^4%d ^1ìèíóò. (%s)", CVM_CHAT_PREFIX, szName, g_iGagTimes[iKey], g_szGagTypes[gp_iGag[iPlayer][PL_GAG_TYPE]]);
}
}
}
case 8: {
gp_iGag[gp_iMenuTarget[pId]][PL_GAG_TYPE] = 0;
return Show_ChooseGagType(pId);
}
}

return PLUGIN_HANDLED;
}

/* [MUTE] */
Show_MuteMenu(const pId, const iPos) {
if(iPos < 0)
return PLUGIN_HANDLED;

new iPlayersNum;
for(new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iIndex) || pId == iIndex)
continue;

gp_iMenuPlayers[pId][iPlayersNum++] = iIndex;
}

new iStart = iPos * 8;
if(iStart > iPlayersNum) iStart = iPlayersNum;
iStart = iStart - (iStart % 8);
gp_iMenuPosition[pId] = iStart / 8;

new iEnd = iStart + 8;
if(iEnd > iPlayersNum) iEnd = iPlayersNum;

new szMenu[512], iLen, iPagesNum = (iPlayersNum / 8 + ((iPlayersNum % 8) ? 1 : 0));
switch(iPagesNum) {
case 0: {
client_print_color(pId, print_team_default, "^3%s ^1Íåòó ïîäõîäÿùèõ Èãðîêîâ.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}
default: iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM Mute] \rÂ\wûáåðèòå èãðîêà \d[%d|%d]^n^n", iPos + 1, iPagesNum);
}

new iItem, iIndex, iBitKeys = MENU_KEY_0, szName[32];
for(new i = iStart; i < iEnd; i++) {
iIndex = gp_iMenuPlayers[pId][i];
get_user_name(iIndex, szName, charsmax(szName));

iBitKeys |= (1 << iItem);

if(IsSetBit(gp_iBit[BIT_MUTTED][pId], iIndex)) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s \r[ \yMUTED \r]^n", ++iItem, szName);
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s^n", ++iItem, szName);
}

for(new i = iItem; i < 8; i++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

if(iEnd < iPlayersNum) {
iBitKeys |= MENU_KEY_9;
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r[9] \wÄàëåå^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");
} else formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_MuteMenu");
}

public Handler_MuteMenu(const pId, const iKey) {
switch(iKey) {
case 8: return Show_MuteMenu(pId, ++gp_iMenuPosition[pId]);
case 9: return Show_MuteMenu(pId, --gp_iMenuPosition[pId]);
default: {
new iPlayer = gp_iMenuPlayers[pId][gp_iMenuPosition[pId] * 8 + iKey];

if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iPlayer)) {
client_print_color(pId, print_team_default, "^3%s ^1Ýòîò Èãðîê íå ïîäõîäèò.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}

new szName[32];
get_user_name(iPlayer, szName, charsmax(szName));

if(IsSetBit(gp_iBit[BIT_MUTTED][pId], iPlayer)) ClearBit(gp_iBit[BIT_MUTTED][pId], iPlayer);
else SetBit(gp_iBit[BIT_MUTTED][pId], iPlayer);

client_print_color(pId, print_team_default, "^3%s ^1Âû %s ñëûøèòå ^4%s", CVM_CHAT_PREFIX, IsSetBit(gp_iBit[BIT_MUTTED][pId], iPlayer) ? "áîëüøå íå" : "òåïåðü", szName);
}
}

return PLUGIN_HANDLED;
}

/* [VOTE GAG] */
Show_VoteGagMenu(const pId, const iPos) {
if(iPos < 0)
return PLUGIN_HANDLED;

new iPlayersNum;
for(new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iIndex) || pId == iIndex)
continue;

#if defined CVM_HIDE_IMMUNITY
if(IsSetBit(gp_iBit[BIT_ACCESS], iIndex) || IsSetBit(gp_iBit[BIT_IMMUNITY], iIndex))
continue;
#endif

#if defined CVM_MODE_AES
if(gp_iRank[iIndex] < CVM_AES_RANK_USE_CHAT && gp_iRank[iIndex] < CVM_AES_RANK_USE_VOICE)
continue;
#endif

#if defined CVM_MODE_CSSTATS_SQL
if(gp_iFrags[iIndex] < CVM_CSSTATS_FRAG_USE_CHAT && gp_iFrags[iIndex] < CVM_CSSTATS_FRAG_USE_VOICE)
continue;
#endif

gp_iMenuPlayers[pId][iPlayersNum++] = iIndex;
}

new iStart = iPos * 8;
if(iStart > iPlayersNum) iStart = iPlayersNum;
iStart = iStart - (iStart % 8);
gp_iMenuPosition[pId] = iStart / 8;

new iEnd = iStart + 8;
if(iEnd > iPlayersNum) iEnd = iPlayersNum;

new szMenu[512], iLen, iPagesNum = (iPlayersNum / 8 + ((iPlayersNum % 8) ? 1 : 0));
switch(iPagesNum) {
case 0: {
client_print_color(pId, print_team_default, "^3%s ^1Íåòó ïîäõîäÿùèõ Èãðîêîâ.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}
default: iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM VoteGag] \rÂ\wûáåðèòå èãðîêà \d[%d|%d]^n^n", iPos + 1, iPagesNum);
}

new iItem, iIndex, iBitKeys = MENU_KEY_0, szName[32];
for(new i = iStart; i < iEnd; i++) {
iIndex = gp_iMenuPlayers[pId][i];
get_user_name(iIndex, szName, charsmax(szName));

#if !(defined CVM_HIDE_IMMUNITY)
if(IsSetBit(gp_iBit[BIT_ACCESS], iIndex) || IsSetBit(gp_iBit[BIT_IMMUNITY], iIndex)) {
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \d%s \r[ \dIMMUNITY \r]^n", ++iItem, szName);
continue;
}
#endif

if(IsSetBit(gp_iBit[BIT_GAGGED], iIndex)) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \d%s \r[ \yGAGGED \r]^n", ++iItem, szName);
else {
iBitKeys |= (1 << iItem);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s^n", ++iItem, szName);
}
}

for(new i = iItem; i < 8; i++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

if(iEnd < iPlayersNum) {
iBitKeys |= MENU_KEY_9;
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\r[9] \wÄàëåå^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");
} else formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r[0] \w%s", iPos ? "Íàçàä" : "Âûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_VoteGagMenu");
}

public Handler_VoteGagMenu(const pId, const iKey) {
switch(iKey) {
case 8: return Show_VoteGagMenu(pId, ++gp_iMenuPosition[pId]);
case 9: return Show_VoteGagMenu(pId, --gp_iMenuPosition[pId]);
default: {
g_iVotePlayerGag[PL_VOTE_GAG_ID] = gp_iMenuPlayers[pId][gp_iMenuPosition[pId] * 8 + iKey];

if(IsNotSetBit(gp_iBit[BIT_CONNECTED], g_iVotePlayerGag[PL_VOTE_GAG_ID])) {
client_print_color(pId, print_team_default, "^3%s ^1Ýòîò Èãðîê íå ïîäõîäèò.", CVM_CHAT_PREFIX);
return PLUGIN_HANDLED;
}

return Show_ChooseVoteGagType(pId);
}
}

return Show_VoteGagMenu(pId, gp_iMenuPosition[pId]);
}

Show_ChooseVoteGagType(const pId) {
static szMenu[165], iBitKeys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_9|MENU_KEY_0;
new iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM VoteGag] \rÂ\wûáåðèòå áëîêèðîâêó^n^n");

new iItem; static iSize = sizeof(g_szGagTypes);
for(iItem = 1; iItem < iSize; iItem++)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%s^n", iItem, g_szGagTypes[iItem]);

for(new iCount = iItem - 1; iCount <= 8; iCount++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[9] \wÍàçàä^n");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[0] \wÂûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_ChooseVoteGagType");
}

public Handler_ChooseVoteGagType(const pId, const iKey) {
switch(iKey) {
case 0..3: {
g_iVotePlayerGag[PL_VOTE_GAG_TYPE] = iKey + 1;
return Show_ChooseVoteGagTime(pId);
}
case 8: {
g_iVotePlayerGag[PL_VOTE_GAG_ID] = 0;
return Show_VoteGagMenu(pId, gp_iMenuPosition[pId]);
}
}

return PLUGIN_HANDLED;
}

Show_ChooseVoteGagTime(const pId) {
static szMenu[160], iBitKeys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_9|MENU_KEY_0;
new iLen = formatex(szMenu, charsmax(szMenu), "\y[CVM VoteGag] \rÂ\wûáåðèòå âðåìÿ^n^n");

new iItem; static iSize = sizeof(g_iGagTimes);
for(iItem = 1; iItem <= iSize; iItem++)
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[%d] \w%d^n", iItem, g_iGagTimes[iItem - 1]);

for(new iCount = iItem - 1; iCount <= 8; iCount++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[9] \wÍàçàä^n");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[0] \wÂûõîä");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_ChooseVoteGagTime");
}

public Handler_ChooseVoteGagTime(const pId, const iKey) {
switch(iKey) {
case 0..5: {
new iPlayer = g_iVotePlayerGag[PL_VOTE_GAG_ID];

if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iPlayer)) {
client_print_color(pId, print_team_default, "^3%s ^1Ýòîò Èãðîê íå ïîäõîäèò.", CVM_CHAT_PREFIX);
return Show_VoteGagMenu(pId, gp_iMenuPosition[pId]);
}

g_iVotePlayerGag[PL_VOTE_GAG_TIME] = (get_systime() + (g_iGagTimes[iKey] * 60));

for(new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iIndex) || iIndex == iPlayer)
continue;

Show_ChooseVoteGagAnswer(iIndex);
}

g_iVoteTotalNo = 1;
set_task(CVM_TIME_VOTE_GAG.0, "task_EndVoteGag");
}
case 8: {
g_iVotePlayerGag[PL_VOTE_GAG_TYPE] = 0;
return Show_ChooseVoteGagType(pId);
}
}

return PLUGIN_HANDLED;
}

public Show_ChooseVoteGagAnswer(const pId) {
new szMenu[512], iBitKeys = MENU_KEY_5|MENU_KEY_6;

new szName[32];
get_user_name(g_iVotePlayerGag[PL_VOTE_GAG_ID], szName, charsmax(szName));

new iLen = formatex(szMenu, charsmax(szMenu), "\r\y[CVM VoteGag] \wÇàáëîêèðîâàòü^n^n\dÈãðîêà \r[ \y%s \r]^n\dÍà âðåìÿ \r[ \y%d ìèíóò \r]^n\dÒèï áëîêèðîâêè \r[ \y%s \r]^n^n", szName, (get_systime() - g_iVotePlayerGag[PL_VOTE_GAG_TIME]) / 60, g_szGagTypes[g_iVotePlayerGag[PL_VOTE_GAG_TYPE]]);

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[5] \wÄà^n");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r[6] \wÍåò^n");

return show_menu(pId, iBitKeys, szMenu, -1, "Show_ChooseVoteGagAnswer");
}

public Handler_ChooseVoteGagAnswer(const pId, const iKey) {
(iKey == 4) ? g_iVoteTotalYes++ : g_iVoteTotalNo++;
client_print_color(pId, print_team_default, "^3%s ^1Âû ïðîãîëîñîâàëè ^4^"%s^"", CVM_CHAT_PREFIX, (iKey == 4) ? "Äà" : "Íåò");

return PLUGIN_HANDLED;
}

public task_EndVoteGag() {
client_print_color(0, print_team_default, "^3%s ^1Ãîëîñîâàíèå çàâåðøåíî. Çà - ^4%d ^1| Ïðîòèâ - ^3%d", CVM_CHAT_PREFIX, g_iVoteTotalYes, g_iVoteTotalNo);

if(g_iVoteTotalYes >= g_iVoteTotalNo) {
new iPlayer = g_iVotePlayerGag[PL_VOTE_GAG_ID];

new tData[ENUM_DATA_PLAYER_GAG];

tData[PL_GAG_TYPE] = g_iVotePlayerGag[PL_VOTE_GAG_TYPE];
tData[PL_GAG_TIME] = g_iVotePlayerGag[PL_VOTE_GAG_TIME];

TrieSetArray(g_tPlayerGag, gp_szIP[iPlayer], tData, sizeof(tData));

SetBit(gp_iBit[BIT_GAGGED], iPlayer);
}

g_iVoteTotalNo = 0;
g_iVoteTotalYes = 0;
}

/*================================================================================
[EVENT]
=================================================================================*/
public EventHook_TeamInfo() {
static pId; pId = read_data(1);
static szTeam[2]; read_data(2, szTeam, 1);

static const szCurTeam[] = {'U', 'T', 'C', 'S'};

if(szCurTeam[gp_iTeam[pId]] != szTeam[0]) {
switch(szTeam[0]) {
case 'U': gp_iTeam[pId] = TEAM_UNNASIGNED;
case 'T': gp_iTeam[pId] = TEAM_T;
case 'C': gp_iTeam[pId] = TEAM_CT;
case 'S': gp_iTeam[pId] = TEAM_SPECATOR;
}
}
}

/*================================================================================
[LOGEVENT]
=================================================================================*/
public LogEventHook_RoundStart() {
for(new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++) {
if(IsSetBit(gp_iBit[BIT_CONNECTED], iIndex))
GetPlayerStats(iIndex);
}
}

/*================================================================================
[FAKEMETA]
=================================================================================*/
public FMHook_VoiceClientListening_Pre(const iReceiver, const iSender) {
if(IsNotSetBit(gp_iBit[BIT_CONNECTED], iReceiver) || IsNotSetBit(gp_iBit[BIT_CONNECTED], iSender) || iReceiver == iSender)
return FMRES_IGNORED;

if(IsSetBit(gp_iBit[BIT_MUTTED][iReceiver], iSender)) {
engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);
return FMRES_SUPERCEDE;
}

if(IsSetBit(gp_iBit[BIT_GAGGED], iSender) && (gp_iGag[iSender][PL_GAG_TYPE] == GAG_TYPE_VOICE || gp_iGag[iSender][PL_GAG_TYPE] == GAG_TYPE_ALL)) {
static iGagTimeLeft; iGagTimeLeft = gp_iGag[iSender][PL_GAG_TIME] - get_systime();

if(!(iGagTimeLeft))
UnGag(iSender);

engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);
return FMRES_SUPERCEDE;
}

#if defined CVM_MODE_CSSTATS_SQL
if(gp_iFrags[iSender] < CVM_CSSTATS_FRAG_USE_VOICE) {
engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);
return FMRES_SUPERCEDE;
}
#endif

#if defined CVM_MODE_AES
if(gp_iRank[iSender] < CVM_AES_RANK_USE_VOICE) {
engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);
return FMRES_SUPERCEDE;
}
#endif

if(IsSetBit(gp_iBit[BIT_LISTEN_ALL], iReceiver))
return FMRES_IGNORED;

#if defined CVM_HEAR_DEATH
if(IsSetBit(gp_iBit[BIT_ALIVE], iReceiver) && (IsSetBit(gp_iBit[BIT_ALIVE], iSender) || IsNotSetBit(gp_iBit[BIT_ALIVE], iSender))) {
#if defined CVM_HEAR_ENEMY
if(gp_iTeam[iReceiver] == gp_iTeam[iSender] || gp_iTeam[iReceiver] != gp_iTeam[iSender])
#else
if(gp_iTeam[iReceiver] == gp_iTeam[iSender])
#endif

return FMRES_IGNORED;
}
#else
if(IsSetBit(gp_iBit[BIT_ALIVE], iReceiver) && IsSetBit(gp_iBit[BIT_ALIVE], iSender)) {
#if defined CVM_HEAR_ENEMY
if(gp_iTeam[iReceiver] == gp_iTeam[iSender] || gp_iTeam[iReceiver] != gp_iTeam[iSender])
#else
if(gp_iTeam[iReceiver] == gp_iTeam[iSender])
#endif

return FMRES_IGNORED;
}
#endif

#if defined CVM_DEATH_HEAR_LIVE
if(IsNotSetBit(gp_iBit[BIT_ALIVE], iReceiver) && (IsNotSetBit(gp_iBit[BIT_ALIVE], iSender) || IsSetBit(gp_iBit[BIT_ALIVE], iSender))) {
#if defined CVM_HEAR_ENEMY
if(gp_iTeam[iReceiver] == gp_iTeam[iSender] || gp_iTeam[iReceiver] != gp_iTeam[iSender])
#else
if(gp_iTeam[iReceiver] == gp_iTeam[iSender])
#endif

return FMRES_IGNORED;
}
#else
if(IsNotSetBit(gp_iBit[BIT_ALIVE], iReceiver) && IsNotSetBit(gp_iBit[BIT_ALIVE], iSender)) {
#if defined CVM_HEAR_ENEMY
if(gp_iTeam[iReceiver] == gp_iTeam[iSender] || gp_iTeam[iReceiver] != gp_iTeam[iSender])
#else
if(gp_iTeam[iReceiver] == gp_iTeam[iSender])
#endif

return FMRES_IGNORED;
}
#endif

engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);
return FMRES_SUPERCEDE;
}

public HamHook_Player_Spawn_Post(const pId) {
if(is_user_alive(pId)) {
if(IsNotSetBit(gp_iBit[BIT_ALIVE], pId))
SetBit(gp_iBit[BIT_ALIVE], pId);
}
}

public HamHook_Player_Killed_Post(const vId) {
if(IsNotSetBit(gp_iBit[BIT_ALIVE], vId))
return HAM_IGNORED;

ClearBit(gp_iBit[BIT_ALIVE], vId);

return HAM_IGNORED;
}

/*================================================================================
[STOCK]
=================================================================================*/
UnGag(const pId) {
ClearBit(gp_iBit[BIT_GAGGED], pId);

gp_iGag[pId][PL_GAG_TYPE] = 0;
gp_iGag[pId][PL_GAG_TIME] = 0;

TrieDeleteKey(g_tPlayerGag, gp_szIP[pId]);
}

GetPlayerStats(const pId) {
#if defined CVM_MODE_AES
new iStatsAES[4];
aes_get_player_stats(pId, iStatsAES);

gp_iRank[pId] = iStatsAES[1];
#endif

#if defined CVM_MODE_CSSTATS_SQL
new iStatsSQL[8], iBodyHits[8];
get_user_stats_sql(pId, iStatsSQL, iBodyHits);

gp_iFrags[pId] = iStatsSQL[0];
#endif
}

/*================================================================================
[UTIL]
=================================================================================*/
UTIL_FixTime(iTimer) {
if(iTimer > 3600)
iTimer = 3600;

new szTime[7];
if(iTimer < 1) add(szTime, charsmax(szTime), "00:00");
else {
new iMin = floatround(iTimer / 60.0, floatround_floor);
new iSec = iTimer - (iMin * 60);

formatex(szTime, charsmax(szTime), "%s%d:%s%d", iMin > 9 ? "" : "0", iMin, iSec > 9 ? "" : "0", iSec);
}

return szTime;
}
Добрый день, форумчане. Изложу вкратце суть проблемы : плагин функционирует, но выборочно (cvm_gag работает далеко не у всех админов (не открывается само гаг-меню, как через menufront_end, так и через консольную команду)). Пример, у меня и еще одного человека права полного доступа. У него функционал полный, у меня нет... Может кто-то уже сталкивался с данной проблемой?
 
Сообщения
11
Реакции
0
Pokemoshka, в принципе, проблему пофиксил заменой плагина, но раз уж он тут в базе лежит, то надо было бы решить трабл или заменить его чем-то более работоспособным )
 

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

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