Теперь вот этот код
Code
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
register_plugin("x","x","x")
RegisterHam(Ham_TakeDamage,"player","fwHamTakeDamage")
register_cvar("health_player","20")
}
public fwHamTakeDamage(idattacker,idinflictor,Float:Damage,damagebits)
{
if(!pev_valid(idattacker)||!pev_valid(idinflictor))
return HAM_IGNORED
if(!is_user_connected(idinflictor))
return HAM_IGNORED
new classname[32]
pev(idattacker,pev_classname,classname,31)
if(equal(classname,"world"))
{
new hp=get_user_health(idinflictor)
hp-=get_cvar_num("health_player")
set_pev(idinflictor,pev_health,hp)
set_hudmessage(0,255,0,-2.0,-1.0,0,6.0,12.0)
show_hudmessage(idinflictor ,"Damage:%d",hp)
}
}