PHP Code:
/* Formatright © 2010, ConnorMcLeod
Descriptive Fire In The Hole Reloaded is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Descriptive Fire In The Hole Reloaded; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#define VERSION "0.2.0"
new g_iLocation
new g_iRmTextMsg
public plugin_init()
{
register_plugin("Descriptive Fire In The Hole Reloaded", VERSION, "ConnorMcLeod")
register_event("SendAudio", "Event_SendAudio_MRAD_FIREINHOLE", "b", "2=%!MRAD_FIREINHOLE")
new szModName[7]
get_modname(szModName, charsmax(szModName))
if(equal(szModName, "czero"))
{
register_event("Location", "Event_Location", "b")
}
}
public Event_Location()
{
g_iLocation = 1
}
public Event_SendAudio_MRAD_FIREINHOLE()
{
g_iRmTextMsg = register_message( get_user_msgid("TextMsg") , "Message_TextMsg" )
}
public Message_TextMsg(iMsgId)
{
new szType[64], szId[3]
get_msg_arg_string(2, szId, charsmax(szId))
new iId = get_user_weapon( str_to_num(szId) )
if( g_iLocation )
{
formatex(szType, charsmax(szType), "^3%%s1^1 @ ^4%%s2^1 ( %s ): %%s3", get_grenade_type( iId ))
}
else
{
formatex(szType, charsmax(szType), "^3%%s1 ^1( %s ): %%s2", get_grenade_type( iId ))
}
set_msg_arg_string(3, szType)
unregister_message(iMsgId, g_iRmTextMsg)
}
get_grenade_type( iId )
{
new szGrenade[20]
switch( iId )
{
case CSW_HEGRENADE :
{
szGrenade = "^3He Grenade^1"
}
case CSW_SMOKEGRENADE :
{
szGrenade = "Smoke Grenade"
}
case CSW_FLASHBANG :
{
szGrenade = "^4FlashBang^1"
}
}
return szGrenade
}
__________________