Kod: Tümünü seç
#include <amxmodx>
#include <fun>
new kill_healed, health_add, health_hs_add, health_max, nKiller, nKiller_hp, nHp_add, nHp_max
public plugin_init()
{
register_plugin("Kill Healed", "2.1", "Dev!l & [TagPro]")
register_event("DeathMsg","death","ae")
kill_healed = register_cvar("amx_killhealed", "1")
health_add = register_cvar("amx_hp", "5")
health_hs_add = register_cvar("amx_hp_hs", "10")
health_max = register_cvar("amx_hp_max", "150")
}
public death()
{
if(get_pcvar_num(kill_healed)!=1) return;
// Killer id
nKiller = read_data(1)
// Change HP Amount when made a Head Shot
if (read_data(3)==1 && read_data(5)==0)
nHp_add = get_pcvar_num(health_hs_add)
else
nHp_add = get_pcvar_num(health_add)
// Updating Killer HP
nHp_max = get_pcvar_num (health_max)
nKiller_hp = get_user_health(nKiller) + nHp_add
// Check Maximum HP
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
// Hud message "Healed +4/+8 hp"
set_hudmessage(255, 192, 203, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(nKiller,"+%d HP Eklendi!",nHp_add)
// Screen fading
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},nKiller)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(255) // red
write_byte(192) // green
write_byte(203) // blue
write_byte(75) // alpha
message_end()
}