here i have added block tk msg by coonormcleod and fixed the float and fixed the fake damage but this not 100% true it could be 1-3 hp less/more
PHP Code:
#include <amxmodx>
#include <hamsandwich>
public plugin_init( ) {
register_plugin( "TK Info", "0.1", "CreePs" )
RegisterHam( Ham_TakeDamage, "player", "bacon_takedamage_player" );
// block teamattck msg by coonormcleod
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")
}
public bacon_takedamage_player( victim, inflictor, attacker, Float:damage, damage_type )
{
if( get_user_team( attacker ) == get_user_team( victim )
&& victim != attacker
&& get_user_weapon( attacker ) != CSW_HEGRENADE
&& get_cvar_num( "mp_friendlyfire" ) )
{
new vName[ 32 ], aName[ 32 ];
get_user_name( victim, vName, sizeof( vName ) - 1 );
get_user_name( attacker, aName, sizeof( aName ) - 1 );
static const TeamName[ ][ ] =
{
"UNASSIGNED",
"T",
"CT",
"SPEC"
}
damage = ( damage / 2.9 );
new iDamage = floatround( damage );
client_print( 0 , print_chat, "(%s) (%s) attacked (%s) (%d HP)", TeamName[ get_user_team( victim ) ], aName, vName, iDamage );
}
return HAM_IGNORED;
}
public Message_TextMsg(iMsgId, iMsgDest, id)
{
if( id )
{
new szMsg[23]
get_msg_arg_string(2, szMsg, charsmax(szMsg))
// http://www.amxmodx.org/funcwiki.php?search=et_msg_arg&go=search
return equal(szMsg, "#Game_teammate_attack")
// http://www.amxmodx.org/funcwiki.php?search=equal&go=search
}
return PLUGIN_CONTINUE
}
__________________