Show the definition for these 2 arrays:
gKillerID[]
gHPKiller[]
Try this
PHP Code:
#include <amxmodx>
#include <hamsandwich>
const MAXPLAYERS = 32;
new gKillerID[ MAXPLAYERS + 1 ];
new gHPKiller[ MAXPLAYERS + 1 ];
#define IsPlayer(%1) (1<=%1<=MAXPLAYERS)
public plugin_init()
{
RegisterHam( Ham_Killed , "player" , "PlayerDeath" )
}
public PlayerDeath( victim , attacker )
{
new vicname[32]
new killname[32]
new health
if( IsPlayer( attacker ) && victim != attacker && is_user_connected( attacker ) )
{
health = get_user_health(attacker);
gKillerID[victim] = attacker;
get_user_name(victim,vicname,31);
get_user_name(attacker,killname,31);
client_print(victim,print_chat,"[ %s te matou, ficando com %i HP ]",killname,health);
gHPKiller[attacker] = health;
}
else
{
client_print( victim , print_chat , "Attacker is self, not a player, or left the server" );
}
}
__________________