Made an example for you
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "Bonus HP Example"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"
new pHeadShot;
new pKill;
new pMaxHp;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("DeathMsg", "eDeath", "a"); // Register DeathMsg Event.
pHeadShot = register_cvar("amx_headshot", "30");
pKill = register_cvar("amx_kill", "15");
pMaxHp = register_cvar("amx_maxhp", "100");
}
public eDeath()
{
// Save our info.
new iAttacker = read_data(1);
new iVictim = read_data(2);
if(is_user_alive(iAttacker) && iAttacker != iVictim && iAttacker != 0 && get_user_team(iAttacker) != get_user_team(iVictim))
{
new iMaxHp = get_pcvar_num(pMaxHp);
new iHeadShot = read_data(3);
if(iHeadShot)
{
set_user_health(iAttacker, clamp(get_user_health(iAttacker) + get_pcvar_num(pHeadShot), 0, iMaxHp));
}
else
{
set_user_health(iAttacker, clamp(get_user_health(iAttacker) + get_pcvar_num(pKill), 0, iMaxHp));
}
}
}
__________________