1.) You mean when zombie infects a human gains glow and hp?
2.)
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
const TASKID_REG = 1000001
new g_time, g_amount
new const zclass_name[] = { "Regenerator" }
new const zclass_info[] = { "Regeneration" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 5750
const zclass_speed = 250
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
const Float:HUD_EVENT_X = -1.0
const Float:HUD_EVENT_Y = 0.1
new g_zclass_Regen
new g_MaxPlayers
new g_MsgSync
public plugin_init()
{
g_time = register_cvar("zp_regen_time", "10")
g_amount = register_cvar("zp_regen_amount", "300")
g_MsgSync = CreateHudSyncObj()
g_MaxPlayers = get_maxplayers()
}
public plugin_precache()
{
register_plugin("[ZP] Zclass : Zombie Regenerator", "1.0", "The_Thing")
g_zclass_Regen = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public zp_round_ended()
{
for(new id = 1; id <= g_MaxPlayers; id++)
{
if(task_exists(id + TASKID_REG)) remove_task(id + TASKID_REG)
}
}
public zp_user_infected_post(player, infector)
{
if (zp_get_user_zombie_class(player) == g_zclass_Regen)
set_task(get_pcvar_float(g_time), "Regenerate", player + TASKID_REG, _, _, "b")
}
public Regenerate(id)
{
new player = id - TASKID_REG
if (!is_user_connected(player) || !is_user_alive(player) || !zp_get_user_zombie(player))
{
remove_task(player + TASKID_REG)
return
}
if(pev(player, pev_health) <= 10.0)
{
remove_task(player + TASKID_REG)
return
}
new ZMaxHealth = zp_get_zombie_maxhealth(player)
if(pev(player, pev_health) < ZMaxHealth)
{
new RegenHealth = pev(player, pev_health) + get_pcvar_num(g_amount)
set_pev(player, pev_health, float(min(RegenHealth, ZMaxHealth)))
set_hudmessage(255, 20, 255, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 3.0, 0.0, -1.0)
ShowSyncHudMsg(player, g_MsgSync, "== Regeneration ==^n!!! +%d Health Gained !!!", get_pcvar_num(g_amount))
static origin[3]
get_user_origin(player, origin)
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_PARTICLEBURST) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]) // z
write_short(50) // radius
write_byte(70) // color
write_byte(3) // duration (will be randomized a bit)
message_end()
}
}