cvary
health_add = register_cvar("amx_vip_hp", "10") // ile za normalne zabójstwo
health_hs_add = register_cvar("amx_vip_hp_hs", "25") // ile za head
health_max = register_cvar("amx_vip_max_hp", "220")// ile max hp
Cały kod
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Administrator"
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
health_add = register_cvar("amx_vip_hp", "10")
health_hs_add = register_cvar("amx_vip_hp_hs", "25")
health_max = register_cvar("amx_vip_max_hp", "220")
register_event("DeathMsg", "hook_death", "a", "1>0")
}
public hook_death()
{
nKiller = read_data(1)
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)
nHp_max = get_pcvar_num (health_max)
if(!(get_user_flags(nKiller) & ADMIN_LEVEL_H))
return;
nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
}