help with npc
hello, I am creating a mode and use this code to create an npc
PHP Code:
public create_zombie()
{
new ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
ent2 = ent
entity_set_origin(ent, g_spawn_point)
entity_set_float(ent, EV_FL_takedamage,1.0)
entity_set_float(ent, EV_FL_health, 100.0)
set_pev(ent,pev_classname,"z1x")
entity_set_model(ent, zombie_model)
entity_set_int(ent, EV_INT_solid, 2)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_PUSHSTEP)
set_pev(ent, pev_victim, 0)
entity_set_byte(ent, EV_BYTE_controller1, 125)
entity_set_byte(ent, EV_BYTE_controller2, 125)
entity_set_byte(ent, EV_BYTE_controller3, 125)
entity_set_byte(ent, EV_BYTE_controller4, 125)
new Float:maxs[3] = {16.0, 16.0, 36.0}
new Float:mins[3] = {-16.0, -16.0, -36.0}
entity_set_size(ent, mins, maxs)
play_anim(ent, ANIM_IDLE, 1.0)
entity_set_float(ent,EV_FL_nextthink, halflife_time() + 0.01)
drop_to_floor(ent)
//RegisterHamFromEntity(Ham_TakeDamage, ent, "fw_zb_takedmg")
RegisterHamFromEntity(Ham_Killed, ent, "fw_zb_killed")
return ent;
}
and I need the combo to detect me the npc, I change this
new ent = engfunc(EngFunc_CreateNamedEntity,engfunc(Eng Func_AllocString,"info_target"))
by
new ent = engfunc(EngFunc_CreateNamedEntity,engfunc(Eng Func_AllocString,"player"))
It detects me but the server throws me, if you could help me :oops:
I speak Spanish and I am using the translator :shock:
|