Hi,
Im trying to make a hud message when a player is killed to show how many damage he did to others players.
I tryed this way, but nothing appears, but the way im catching the damage is correct because I already tested it.
How can I make it?
PHP Code:
#include <amxmodx>
#include <cstrike>
#define MAX_PLAYERS 32
new mDano[MAX_PLAYERS+1][MAX_PLAYERS+1]
public plugin_init()
{
register_event("DeathMsg", "Morte", "a");
register_event("Damage", "Dano", "b", "2!0", "3=0", "4!0")
}
public Morte(id)
{
new morto = read_data(2)
new nome[34], hud[1102]
new texto[1102]
for(new i; i < 33; i++)
{
if(mDano[morto][i] > 0)
{
get_user_name(i, nome, 32);
format(texto, 1101, ": %i^n",mDano[morto][i])
add(nome, 33, texto, 0);
add(hud, 1101, nome, 0);
set_hudmessage(255, 0,0, 1.0, 1.0, 0, 0.0, 1.0 + 0.1, 0.0, 0.0, -1);
show_hudmessage(morto, hud);
}
}
}
public Dano(id)
{
static attacker; attacker = get_user_attacker(id)
static damage; damage = read_data(2)
if( 1 <= attacker <= 32)
{
if(is_user_alive(attacker) && is_user_connected(id) && cs_get_user_team(id) != cs_get_user_team(attacker))
{
mDano[attacker][id] += damage
}
}
}
__________________