Hello, i have this code for a custom message that replaces the kill sprite from top right.
Problem is that i use plugins with fakedamage, i think, and some times it gives the messages
that: "player killed himself" i only modify damage of knife,glock and awp. Those 3 weapons give that message error.
Is there any way around this? like detect who is the inflictor of damage to reference with the message?
HTML Code:
#include <amxmodx>
#include <reapi>
#define PLUGIN "[Reapi] Mensaje de Muerte en el Chat"
#define VERSION "1.5"
#define AUTHOR "[N]drs"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_message(get_user_msgid("DeathMsg"), "OnServer_SendMessage_DeathMsg")
RegisterHookChain(RG_CBasePlayer_Killed, "OnPlayer_Killed_Post", true)
}
public OnServer_SendMessage_DeathMsg()
return PLUGIN_HANDLED
public OnPlayer_Killed_Post(iVictim, iAttacker, iGib)
{
static szWeaponName[25]
if(!iAttacker || iAttacker == iVictim)
{
client_print_color(0, print_team_grey, "^4[Server] ^3^4%n ^3 killed himself", iVictim)
return
}
get_weaponname(get_user_weapon(iAttacker), szWeaponName, charsmax(szWeaponName))
replace_string(szWeaponName, charsmax(szWeaponName), "weapon_", "")
client_print_color(0, print_team_grey, "[Server]^4%n ^3killed ^4%n ^3with ^4%s", iAttacker, iVictim, szWeaponName)
}