Kod: Tümünü seç
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "ZMM"
#define VERSION "1.4"
#define AUTHOR "biohy"
new Float:g_LastThink[33], bool:ready[33]
new cvar_health, cvar_readytime, cvar_time, g_heal
new const health_sound[] = "zm/zombie_heal.wav"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPostThink, "Player_Think", 1)
cvar_health = register_cvar("zp_health", "300.0") // Ñêîëüêî õï âîñòîíàâëèâàòü
cvar_readytime = register_cvar("zp_health_readytime", "3.0") // Ñêîëüêî æäàòü äî íà÷àëà ğåãåíåğàöèè
cvar_time = register_cvar("zp_health_time", "1.0") // Ñêîëüêî èäåò ğåãåíèğàöèÿ
}
public plugin_precache()
{
engfunc(EngFunc_PrecacheSound, health_sound)
g_heal = precache_model("sprites/zm/cso_heal.spr")
}
public Player_Think(iPlayer)
{
if(!is_user_alive(iPlayer) || !zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer))
return
new Float:Velocity[3]
pev(iPlayer, pev_velocity, Velocity)
if(vector_length(Velocity) > 0)
{
ready[iPlayer] = false
return
}
new Float:CurTime
global_get(glb_time, CurTime)
if(!ready[iPlayer])
{
ready[iPlayer] = true
g_LastThink[iPlayer] = CurTime + get_pcvar_float(cvar_readytime)
}
if(CurTime < g_LastThink[iPlayer])
return
new Float:health = floatmin(pev(iPlayer, pev_health) + get_pcvar_float(cvar_health), float(zp_get_zombie_maxhealth(iPlayer)))
set_pev(iPlayer, pev_health, health)
engfunc(EngFunc_EmitSound, iPlayer, CHAN_BODY, health_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
new origin[3]
get_user_origin(iPlayer,origin)
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITE)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]+=30)
write_short(g_heal)
write_byte(8)
write_byte(255)
message_end()
g_LastThink[iPlayer] = CurTime + get_pcvar_float(cvar_time)
}