AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changin Glow, depending off the hp (https://forums.alliedmods.net/showthread.php?t=87884)

dogandcat 03-17-2009 18:14

Changin Glow, depending off the hp
 
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

Exolent[jNr] 03-17-2009 18:15

Re: Changin Glow, depending off the hp
 
Code:

hp1 = get_user_health(id)
Should be:
Code:

hp1 = get_user_health(ent)

dogandcat 03-17-2009 22:08

Re: Changin Glow, depending off the hp
 
thanks man,+k.

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

bye.


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

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