#define BLOCK_SND // блокировать звук Fire in the hole.
#define BLOCK_MSG // Блокировать сообщение Fire in the hole в чате.
#define BLOCK_RADIO // Блокировать радио команды. (Z, X, C)
#define BLOCK_RADIO_ICON // Блокировать спрайт над головой игроков при использовании радиокоманд.
#define START_ROUND_BLOCK_RADIO // Блокировать радио команды при старте раунда. типа go go go...
#define BLOCK_HUD_TEXT // Блокировать худ подсказки. В низу экрана типа у вас есть бомба и...
#include <amxmodx>
#if defined BLOCK_SND
new const g_sFireInTheHoleSound[] = "%!MRAD_FIREINHOLE"
new sound[sizeof(g_sFireInTheHoleSound)]
#endif
#if defined START_ROUND_BLOCK_RADIO
new Float:g_flRoundStartGameTime
new gmsgSendAudio, g_iMsgSendAudio
new Trie:g_tStartRoundSounds
#endif
#if defined BLOCK_RADIO
new const radio[][] =
{
"radio1", "radio2", "radio3", "coverme", "takepoint", "holdpos",
"regroup", "followme", "takingfire", "go", "fallback", "sticktog",
"getinpos", "stormfront", "report", "roger", "enemyspot", "needbackup",
"sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
}
#define register_cmd_list(%0,%1,%2) for (new i = 0; i < sizeof(%1); i ++) register_%0(%1[i], %2)
#endif
#if defined BLOCK_RADIO_ICON
new g_Radio
public plugin_precache()
g_Radio = precache_model("sprites/radio.spr")
#endif
public plugin_init()
{
register_plugin("Radio Hudmsg Block", "1.0", "xz kto")
#if defined BLOCK_HUD_TEXT
set_msg_block(get_user_msgid("HudTextArgs"), BLOCK_SET)
#endif
#if defined BLOCK_SND
register_message(get_user_msgid("SendAudio"), "msgSendAudio")
#endif
#if defined BLOCK_MSG
register_message(get_user_msgid("TextMsg"), "msgTextMsg")
#endif
#if defined BLOCK_RADIO
register_cmd_list(clcmd, radio, "cmd_block")
#endif
#if defined BLOCK_RADIO_ICON
register_message(SVC_TEMPENTITY, "Block_Radio_Icon")
#endif
#if defined START_ROUND_BLOCK_RADIO
gmsgSendAudio = get_user_msgid("SendAudio")
register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")
new szStartRoundSounds[][] =
{
"%!MRAD_LOCKNLOAD", "%!MRAD_MOVEOUT", "%!MRAD_LETSGO",
"%!MRAD_GO", "%!MRAD_ELIM", "%!MRAD_GETOUT", "%!MRAD_VIP"
}
g_tStartRoundSounds = TrieCreate()
for(new i; i < sizeof(szStartRoundSounds); i ++)
{
TrieSetCell(g_tStartRoundSounds, szStartRoundSounds[i], 1)
}
#endif
}
#if defined BLOCK_SND
public msgSendAudio()
{
get_msg_arg_string(2, sound, charsmax(sound))
return equali(sound, g_sFireInTheHoleSound)
}
#endif
#if defined BLOCK_MSG
public msgTextMsg()
{
if (get_msg_args() != 5 || get_msg_argtype(5) != ARG_STRING)
return PLUGIN_CONTINUE
static text[18]; get_msg_arg_string(5, text, charsmax(text))
return !strcmp(text, "#Fire_in_the_hole") ? PLUGIN_HANDLED : PLUGIN_CONTINUE
}
#endif
#if defined BLOCK_RADIO
public cmd_block(id)
return PLUGIN_HANDLED
#endif
#if defined BLOCK_RADIO_ICON
public Block_Radio_Icon(msgId, msgDest, msgEnt)
{
#pragma unused msgId, msgDest, msgEnt
if (get_msg_arg_int(1) == TE_PLAYERATTACHMENT)
{
if (get_msg_arg_int(4) == g_Radio)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
#endif
#if defined START_ROUND_BLOCK_RADIO
public LogEvent_Round_Start()
{
g_flRoundStartGameTime = get_gametime()
if (!g_iMsgSendAudio)
{
g_iMsgSendAudio = register_message(gmsgSendAudio, "Message_SendAudio")
}
}
public Message_SendAudio()
{
if (get_gametime() != g_flRoundStartGameTime)
{
unregister_message(gmsgSendAudio, g_iMsgSendAudio)
g_iMsgSendAudio = 0
return PLUGIN_CONTINUE
}
new szArg2[18]
get_msg_arg_string(2, szArg2, charsmax(szArg2))
if (TrieKeyExists(g_tStartRoundSounds, szArg2))
{
if (get_msg_block(SVC_TEMPENTITY) == BLOCK_NOT)
{
set_msg_block(SVC_TEMPENTITY, BLOCK_ONCE)
}
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
#endif