Quote:
Originally Posted by minimiller
public fwdTakeDamage(iVictim, iWeapon, iAttacker, Float:flDamage, iDmgBits)
|
This is wrong, second param is not the weapon, it's in most cases the same as attacker. It can be the nade id when it is a HE.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
new const VERSION[] = "0.0.1"
public plugin_init()
{
register_plugin("Regeneration", VERSION, "ConnorMcLeod")
RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage")
}
public CBasePlayer_TakeDamage(id , eInflictor, eAttacker, Float:flDamage, bitsDamageType )
{
// First check if attacker is a player
if( eAttacker != id && is_user_connected( eAttacker ) )
{
new szName[32]
get_user_name(id, szName, charsmax(szName))
client_print(eAttacker, print_chat, "You've just hit %s! Nice work.", szName)
}
}
__________________