Sorry, what are you trying to say?
By the way,
New.ZM.Life, just try below code. ;)
PHP Code:
#include <amxmodx>
#include <zp50_core>
#include <zp50_class_zombie>
#include <fakemeta>
// Regeneration Zombie Attributes
new const zombieclass1_name[] = "Regenerate Zombie"
new const zombieclass1_info[] = "Regenerate Health"
new const zombieclass1_models[][] = { "zombie_source" }
new const zombieclass1_clawmodels[][] = { "models/zombie_plague/v_knife_zombie.mdl" }
const zombieclass1_health = 2000
const Float:zombieclass1_speed = 1.00
const Float:zombieclass1_gravity = 0.89
const Float:zombieclass1_knockback = 1.00
#define TASK_RESET 19942014
// Variables
new g_iRegenerate, g_ZombieHealth
public plugin_init()
{
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
register_event("DeathMsg", "event_DeathMsg", "a", "1>0")
g_ZombieHealth = register_cvar("zp_zombie_health", "4500") // Set the limit of health regeneration based on zombie health
}
public plugin_precache()
{
register_plugin("[ZP] Zombie Class: Regeneration", ZP_VERSION_STRING, "ZP Dev Team")
new index
g_iRegenerate = zp_class_zombie_register(zombieclass1_name, zombieclass1_info, zombieclass1_health, zombieclass1_speed, zombieclass1_gravity)
zp_class_zombie_register_kb(g_iRegenerate, zombieclass1_knockback)
for (index = 0; index < sizeof zombieclass1_models; index++)
zp_class_zombie_register_model(g_iRegenerate, zombieclass1_models[index])
for (index = 0; index < sizeof zombieclass1_clawmodels; index++)
zp_class_zombie_register_claw(g_iRegenerate, zombieclass1_clawmodels[index])
}
// Remove the ability in the new round
public event_new_round()
{
new iPlayers[32]
new iPlayerCount, i, id
get_players(iPlayers, iPlayerCount, "a")
for(i = 0; i < iPlayerCount; i++)
{
id = iPlayers[i]
remove_task(id+TASK_RESET)
}
}
// Remove the ability when player is dead
public client_disconnect(id)
{
remove_task(id+TASK_RESET)
}
// Remove the ability when player is dead
public event_DeathMsg()
{
new id; id = read_data(2)
remove_task(id+TASK_RESET)
}
// Remove the ability when player become human
public zp_fw_core_cure_post(id)
{
remove_task(id+TASK_RESET)
}
public zp_fw_core_infect_post(id, attacker)
{
if (zp_class_zombie_get_current(id) == g_iRegenerate)
{
set_task(10.0, "iHealth", id+TASK_RESET, _, _, "b")
}
}
public iHealth(id)
{
id -= TASK_RESET
if(is_user_alive(id) && zp_core_is_zombie(id))
{
if(zp_class_zombie_get_current(id) == g_iRegenerate)
{
set_pev(id, pev_health, floatmin(pev(id, pev_health) + float(10), get_pcvar_float(g_ZombieHealth)))
}
}
}