Raised This Month: $ Target: $400
 0% 

Changin Glow, depending off the hp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dogandcat
BANNED
Join Date: Jan 2009
Old 03-17-2009 , 18:14   Changin Glow, depending off the hp
Reply With Quote #1

Well, this is my code.
Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

static const zname[] = { "Zombie Rage" }
static const zinfo[] = { "WTF" }
static const zmodel[] = { "zombie_source" }
static const zweapmodel[] = { "v_knife_zombie.mdl" }
const zhealth = 3300;
const zspeed = 245;
const Float:zgravity = 0.7;
const Float:zknockback = 0.5;

new g_rage;

public plugin_precache()
    g_rage = zp_register_zombie_class(zname, zinfo, zmodel, zweapmodel, zhealth, zspeed, zgravity, zknockback);
    
public plugin_init()
{
    register_plugin("[ZP] Class: Rage", "0.1", "DoggY");
    
    register_forward(FM_AddToFullPack,"fw_addtofullpack",1);
}

public fw_addtofullpack(es_handle,e,ent,host,hostflags,player,pSet,id)
{
    if( !is_user_alive(ent) || !is_user_alive(host) )
        return FMRES_IGNORED;

    if( zp_get_user_zombie(ent) && zp_get_user_zombie_class(ent) == g_rage )
    {
        new hp1;
        hp1 = get_user_health(id)
        
        if (hp1 < 300)
        {
            set_es(es_handle,ES_RenderFx,kRenderFxGlowShell);
            set_es(es_handle,ES_RenderColor,{255,0,0});
        }
        else if (hp1 < 600)
        {
            set_es(es_handle,ES_RenderFx,kRenderFxGlowShell);
            set_es(es_handle,ES_RenderColor,{240,170,0});
        }
        else if (hp1 < 1400)
        {
            set_es(es_handle,ES_RenderFx,kRenderFxGlowShell);
            set_es(es_handle,ES_RenderColor,{220,220,0});
        }
        else if (hp1 < 2600)
        {
            set_es(es_handle,ES_RenderFx,kRenderFxGlowShell);
            set_es(es_handle,ES_RenderColor,{0,255,0});
        }
    }

    return FMRES_IGNORED;
}

the glow is ever red. it doesn´t change, why?

please help :S
dogandcat is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-17-2009 , 18:15   Re: Changin Glow, depending off the hp
Reply With Quote #2

Code:
hp1 = get_user_health(id)
Should be:
Code:
hp1 = get_user_health(ent)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
dogandcat
BANNED
Join Date: Jan 2009
Old 03-17-2009 , 22:08   Re: Changin Glow, depending off the hp
Reply With Quote #3

thanks man,+k.

a Q. if i want to give him a TE_DLIGHT, is the same method for the changin color ??

bye.
dogandcat is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode