AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with npc (https://forums.alliedmods.net/showthread.php?t=334484)

djkaku 09-27-2021 15:44

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
(entg_spawn_point)
   
    
entity_set_float(entEV_FL_takedamage,1.0)
    
entity_set_float(entEV_FL_health100.0)
   
    
set_pev(ent,pev_classname,"z1x")
    
entity_set_model(entzombie_model)
    
entity_set_int(entEV_INT_solid2)
   
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
   
    
set_pev(entpev_victim0)
   
    
entity_set_byte(entEV_BYTE_controller1125)
    
entity_set_byte(entEV_BYTE_controller2125)
    
entity_set_byte(entEV_BYTE_controller3125)
    
entity_set_byte(entEV_BYTE_controller4125)
   
    new 
Float:maxs[3] = {16.016.036.0}
    new 
Float:mins[3] = {-16.0, -16.0, -36.0}
    
entity_set_size(entminsmaxs)
   
    
play_anim(entANIM_IDLE1.0)
   
    
entity_set_float(ent,EV_FL_nextthinkhalflife_time() + 0.01)
    
drop_to_floor(ent)
   
    
//RegisterHamFromEntity(Ham_TakeDamage, ent, "fw_zb_takedmg")
    
RegisterHamFromEntity(Ham_Killedent"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:

DJEarthQuake 09-27-2021 16:40

Re: help with npc
 
https://www.amxmodx.org/api/engine_stocks/find_ent

Celena Luna 09-27-2021 22:21

Re: help with npc
 
Quote:

Originally Posted by djkaku (Post 2759029)
and I need the combo to detect me the npc

What do you mean by this?

LiZou Mapper 10-04-2021 17:35

Re: help with npc
 
what do you mean?


All times are GMT -4. The time now is 15:40.

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