#include <amxmodx>
#define PLUGIN "SpacePK.ru DM BlockRadio"
#define VERSION "1.0"
#define AUTHOR "You?"
new gmsgTextMsg
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
gmsgTextMsg = get_user_msgid("TextMsg")
register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
register_clcmd("radio1", "block")
register_clcmd("radio2", "block")
register_clcmd("radio3", "block")
}
public Message_SendAudio(iMsgId, iMsgDest, id)
{
remove_icon(id)
if( id )
{
new szRadioKey[19]
static const MRAD_FIREINHOLE[] = "%!MRAD_FIREINHOLE"
get_msg_arg_string(2, szRadioKey, charsmax(szRadioKey))
if( equal(szRadioKey, MRAD_FIREINHOLE) )
{
if( get_msg_block(gmsgTextMsg) != BLOCK_SET )
{
set_msg_block(gmsgTextMsg, BLOCK_ONCE)
}
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
public block(id)
{
return PLUGIN_HANDLED
}
public remove_icon(id)
{
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_KILLPLAYERATTACHMENTS)
write_byte(id)
message_end()
}