Thread: [Subplugin Submission] [T] List of Modified + Requested Plugins
View Single Post
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-17-2014 , 17:45   Re: [ZP] List of Modified + Requested Plugin (17/11/2014)
Reply With Quote #496

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_iRegenerateg_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_namezombieclass1_infozombieclass1_healthzombieclass1_speedzombieclass1_gravity)
    
    
zp_class_zombie_register_kb(g_iRegeneratezombieclass1_knockback)
    
    for (
index 0index sizeof zombieclass1_modelsindex++)
        
zp_class_zombie_register_model(g_iRegeneratezombieclass1_models[index])
    for (
index 0index sizeof zombieclass1_clawmodelsindex++)
        
zp_class_zombie_register_claw(g_iRegeneratezombieclass1_clawmodels[index])
}

// Remove the ability in the new round
public event_new_round()
{
    new 
iPlayers[32
    new 
iPlayerCountiid
    get_players
(iPlayersiPlayerCount"a"
    
    for(
0iPlayerCounti++)
    {
        
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 
idid 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(idattacker)
{
    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(idpev_healthfloatmin(pev(idpev_health) + float(10), get_pcvar_float(g_ZombieHealth)))
        }
    }

Attached Files
File Type: sma Get Plugin or Get Source (c_2.sma - 821 views - 2.7 KB)

Last edited by zmd94; 11-27-2014 at 23:39.
zmd94 is offline