Here you go
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#define AUTHOR "Turanga_Leela, Lev @ AGHL.RU DevTeam"
#define PLUGIN "Vampire"
#define VERSION "0.2"
#define VERSION_CVAR "vampire_version"
#define I_MAX 999 // change max Hp & Ap
new const m_LastHitGroup = 90;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar(VERSION_CVAR, VERSION, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED);
register_event("DeathMsg", "OnDeathMsg", "a");
}
public OnDeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);
new hitplace = get_pdata_int(victim, m_LastHitGroup);
new health = get_user_health(killer);
if (health > 0 && is_user_alive(killer))
{
new irandom = 5;
if (health < I_MAX)
{
health += irandom;
if (health > I_MAX)
health = I_MAX;
set_user_health(killer, health);
}
new armor = get_user_armor(killer);
if (armor < I_MAX)
{
armor += irandom;
if (armor > I_MAX)
armor = I_MAX;
set_user_armor(killer, armor);
}
set_hudmessage(0, 255, 255, -1.0, 0.25, 0, 7.0, 5.0, 1.0, 0.0, 0.0);
new message[64];
format(message, sizeof(message), "+5HP | +5AP");
show_hudmessage(killer, message);
}
}