Did you mean if i shoot you and you have 50hp, my hp will be set to 50 ?
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
RegisterHam( Ham_TakeDamage, "player", "ham_takedamage" );
public ham_takedamage( victim, inflictor, attacker, Float:damage, damagebits )
{
if( ! ( damagebits & DMG_BULLET ) )
return HAM_IGNORED;
static fHealth;
pev( victim, pev_health, fHealth );
if( pev( attacker, pev_health ) != fHealth )
set_pev( attacker, pev_health, fHealth );
return HAM_IGNORED;
}
If you want to add your hp to mine
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
public plugin_init()
RegisterHam( Ham_TakeDamage, "player", "ham_takedamage" );
public ham_takedamage( victim, inflictor, attacker, Float:damage, damagebits )
{
if( ! ( damagebits & DMG_BULLET ) )
return HAM_IGNORED;
static f_vHealth, f_aHealth;
pev( victim, pev_health, f_vHealth );
pev( attacker, pev_health, f_aHealth );
set_pev( attacker, pev_health, f_aHealth+f_vHealth );
return HAM_IGNORED;
}
__________________