You could directly work in Post TakeDamage and only check pev(victim, pev_dmg_take) and take it as an integer.
This should be ok :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.0.1"
#define PLUGIN ""
#define FIRST_PLAYER_ID 1
#define MAX_PLAYERS 32
new g_iMaxPlayers
#define IsPlayer(%1) ( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )
new g_iDamage[MAX_PLAYERS+1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
RegisterHam(Ham_Spawn, "player", "Ham_CBasePlayer_Spawn_Post", 1)
RegisterHam(Ham_TakeDamage, "player", "CBasePlayer_TakeDamage_Post", 1)
g_iMaxPlayers = get_maxplayers()
}
public Ham_CBasePlayer_Spawn_Post( id )
{
g_iDamage[id] = 0
}
public CBasePlayer_TakeDamage_Post(id, iInflictor, iAttacker, Float:flDamage, bitsDamageType)
{
if( id != iAttacker && IsPlayer(iAttacker) && cs_get_user_team(id) != cs_get_user_team(iAttacker) )
{
g_iDamage[iAttacker] += pev(id, pev_dmg_take)
if( !is_user_alive(id) )
{
g_iDamage[iAttacker] += get_user_health(id)
}
}
}
Anyway, i think csx module already provides some natives that could give you exactly what you want.
__________________