Originally Posted by MayroN
(Post 2707725)
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(ent, Origin) entity_set_float(ent, EV_FL_takedamage, 1.0) entity_set_float(ent, EV_FL_health, npc_healthpoints + 1000.0) entity_set_string(ent, EV_SZ_classname, "npc_phobos") entity_set_model(ent, npc_mdl) entity_set_int(ent, EV_INT_solid, SOLID_BBOX) entity_set_int(ent, EV_INT_movetype, MOVETYPE_PUSHSTEP) new Float:maxs[3] = {25.0, 50.0, 200.0} new Float:mins[3] = {-25.0, -50.0, -35.0} entity_set_size(ent, mins, maxs) entity_set_int(ent, EV_INT_modelindex, y_npc_mdl) anim(ent, 5) set_task(0.1, "phobos_done", ent+npc_start_think) // Phobos prepare time if(!y_start_npc) { y_start_npc = 1 RegisterHamFromEntity(Ham_TakeDamage, ent, "phobos_take_damage", 1) } for(new i = 0; i < get_maxplayers(); i++) { if(is_user_alive(i) && entity_range(ent, i) <= 400) {
} } y_hpbar = create_entity("env_sprite") set_pev(y_hpbar, pev_scale, 0.2) set_pev(y_hpbar, pev_owner, ent) engfunc(EngFunc_SetModel, y_hpbar, hp_spr) set_task(0.1, "phobos_ready", ent+npc_restart, _, _, "b") set_task(random_float(7.0, 15.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(ent, pev_origin, Origin) Origin[2] += 270.0 engfunc(EngFunc_SetOrigin, y_hpbar, Origin) pev(ent, pev_health, phobos_health) if(npc_healthpoints < (phobos_health - 1000.0)) { set_pev(y_hpbar, pev_frame, 100.0) } else { set_pev(y_hpbar, pev_frame, 100.0 - ((((phobos_health - 1000.0) - 1 ) * 100) / npc_healthpoints)) } }
|