Thread: [Solved] HP Bar
View Single Post
AnimalMonster
Senior Member
Join Date: May 2020
Old 06-29-2020 , 22:38   Re: HP Bar
Reply With Quote #6

Quote:
Originally Posted by MayroN View Post
I'll ask again here.How to get rid of sharp jerks of the sprite with the movement of Entity here?
PHP Code:
public create_phobos()
{
    new 
ent create_entity("info_target")

        if(!
is_valid_ent(ent))
          return;


    
y_think ent
    
static Float:Origin[3]
    
Origin[0] = y_spawn_points[0]
    
Origin[1] = y_spawn_points[1]
    
Origin[2] = y_spawn_points[2]
    
entity_set_origin(entOrigin)
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_healthnpc_healthpoints 1000.0)
    
entity_set_string(entEV_SZ_classname"npc_phobos")
    
entity_set_model(entnpc_mdl)
    
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
    new 
Float:maxs[3] = {25.050.0200.0}
    new 
Float:mins[3] = {-25.0, -50.0, -35.0}
    
entity_set_size(entminsmaxs)
    
entity_set_int(entEV_INT_modelindexy_npc_mdl)
    
anim(ent5)
    
set_task(0.1"phobos_done"ent+npc_start_think)            // Phobos prepare time
    
if(!y_start_npc)
    {
        
y_start_npc 1
        RegisterHamFromEntity
(Ham_TakeDamageent"phobos_take_damage"1)
    }
    for(new 
0get_maxplayers(); i++)
    {
        if(
is_user_alive(i) && entity_range(enti) <= 400)
        {

        }
    }
    
y_hpbar create_entity("env_sprite")
    
set_pev(y_hpbarpev_scale0.2)
    
set_pev(y_hpbarpev_ownerent)
    
engfunc(EngFunc_SetModely_hpbarhp_spr)    
    
set_task(0.1"phobos_ready"ent+npc_restart__"b")
    
set_task(random_float(7.015.0), "punish"npc_ability)
}

public 
phobos_ready(ent)
{
    
ent -= npc_restart
    
if(!pev_valid(ent))
    {
        
remove_task(ent+npc_restart)
        return
    }
    static 
Float:Origin[3], Float:phobos_health
    pev
(entpev_originOrigin)
    
Origin[2] += 270.0    
    engfunc
(EngFunc_SetOriginy_hpbarOrigin)
    
pev(entpev_healthphobos_health)
    if(
npc_healthpoints < (phobos_health 1000.0))
    {
        
set_pev(y_hpbarpev_frame100.0)
    }
    else
    {
        
set_pev(y_hpbarpev_frame100.0 - ((((phobos_health 1000.0) - ) * 100) / npc_healthpoints))
    }        

I don't really know but you can edit the spirite if there are some sharp thing you don t wanna see
#idon'treallyknow

Last edited by AnimalMonster; 06-29-2020 at 22:39.
AnimalMonster is offline