Hi. I got some problems with damage display using HamSandwich.
Code:
#include <amxmodx>
#include <hamsandwich>
new g_iHudSyncObj;
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "hTakeDamage", 1);
g_iHudSyncObj = CreateHudSyncObj();
}
public hTakeDamagePost(iVictim, iInflictor, iAttacker, Float:fDmg)
{
if (!is_user_connected(iVictim) || !is_user_connected(iAttacker))
return;
if (iVictim != iAttacker && get_user_team(iVictim) != get_user_team(iAttacker))
{
set_hudmessage(200, 200, 200, -1.0, 0.46, 0, 6.0, 2.0, 0.1, 0.1, -1);
ShowSyncHudMsg(iAttacker, g_iHudSyncObj, "%i^n", floatround(fDmg));
}
}
Sometimes it shows more or less damage than the victim loses. Like you hit for 16, but victim lost only 8. Or you hit for 96, but victim (which had 100 HP) died.
For example use Glock's Burst-Fire mode and shoot to other player's head. It will show 96 while the other player is dead.
Anyone can suggest how to fix this?
__________________