View Single Post
WtF S3R6I0
New Member
Join Date: Nov 2011
Old 11-15-2011 , 21:01   Re: convert zombie class rage for zp 5.0
Reply With Quote #2

PHP Code:
#define PLUGIN "xxx"
#define VERSION "xxx"
#define AUTHOR "xxx"

#define TASK_CHECK 50000
#define ID_CHECK (taskid - TASK_CHECK)

// xxx Zombie Attributes
new const zclass6_name[] = "xxx"
new const zclass6_info[] = "xxx"
new const zclass6_model[][] = { "xxx" }
new const 
zclass6_clawmodel[][] = { "xxx" }
const 
zclass6_health xxx
const Float:zclass6_speed xxx
const Float:zclass6_gravity xxx
const Float:zclass6_knockback xxx

new g_zclass_rage

public plugin_init() 
{
    
register_plugin(PLUGIN,VERSION,AUTHOR)
}

public 
plugin_precache()
{
    
register_cvar("zp_rage_aura_radius""15.0")
    
register_cvar("zp_rage_aura_red""0")
    
register_cvar("zp_rage_aura_green""255")
    
register_cvar("zp_rage_aura_blue""0")
    new 
index
    g_zclass_rage 
zp_class_zombie_register(zclass6_name,zclass6_info,zclass6_health,zclass6_speed,zclass6_gravity)
    
zp_class_zombie_register_kb(g_zclass_ragezclass6_knockback)
    for (
index 0index sizeof zclass6_modelindex++)
        
zp_class_zombie_register_model(g_zclass_rage,zclass6_model[index])
    for (
index 0index sizeof zclass6_clawmodelindex++)
        
zp_class_zombie_register_claw(g_zclass_rage,zclass6_clawmodel[index])
    
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_class_zombie_get_current(id) == g_zclass_rage)
    {
        
set_task(1.5"Aura"id__"b")
    }
    
    
check(id)
}

public 
zp_user_humanized_post(id)
{
    
fm_set_rendering(idkRenderFxNoneFloat:{ 0.0255.00.0 }, kRenderNormal0)
}

public 
efectos(taskid)

    if (
zp_class_zombie_get_current(ID_CHECK) == g_zclass_rage && zp_core_is_zombie(ID_CHECK))
{
    if(
pev(ID_CHECKpev_maxspeed) != 1.0)
        
fm_set_rendering(ID_CHECKkRenderFxGlowShellFloat:{ 0.0255.00.0 }, kRenderNormal0)
    
set_task(0.2"efectos"ID_CHECK+TASK_CHECK)
}

public 
check(id)
{
    if (
zp_class_zombie_get_current(id) == g_zclass_rage && zp_core_is_zombie(id))
        
efectos(id+TASK_CHECK)
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_CHECK)
}

public 
Aura(id)
{
    if (
zp_core_is_zombie(id)) {
        if (
zp_class_zombie_get_current(id) == g_zclass_rage) {        
            if (!
is_user_alive(id))
                return 
PLUGIN_HANDLED

            
static Float:originF[3]
            
pev(idpev_originoriginF)

            
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
            
write_byte(TE_DLIGHT)
            
engfunc(EngFunc_WriteCoordoriginF[0])
            
engfunc(EngFunc_WriteCoordoriginF[1])
            
engfunc(EngFunc_WriteCoordoriginF[2])
            
write_byte(get_cvar_num("zp_rage_aura_radius"))
            
write_byte(get_cvar_num("zp_rage_aura_red"))
            
write_byte(get_cvar_num("zp_rage_aura_green"))
            
write_byte(get_cvar_num("zp_rage_aura_blue"))
            
write_byte(2)
            
write_byte(0)
            
message_end()
        } else {
            
remove_task(id)
        }
    } else {
        
remove_task(id)
    }
    
    return 
PLUGIN_CONTINUE
}

stock fm_set_rendering(entityfx kRenderFxNoneFloat:color[3] = { 0.0255.00.0 }, render kRenderNormalamount 0)
{
    
set_pev(entitypev_renderfxfx)
    
set_pev(entitypev_rendercolorcolor)
    
set_pev(entitypev_rendermoderender)
    
set_pev(entitypev_renderamtfloat(amount))

WtF S3R6I0 is offline