All right, code:
PHP Code:
public myent(id){
static Float:origin[3]
pev(id, pev_origin, origin)
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if(!ent)
return
set_pev(ent, pev_classname, "myent")
engfunc(EngFunc_SetModel, ent, MYMODEL)
static Float:MinBox[3]
static Float:MaxBox[3]
for(new a; a<3; a++) {
MinBox[a] = -1.0
MaxBox[a] = 1.0
}
engfunc(EngFunc_SetSize, ent, MinBox, MaxBox)
engfunc(EngFunc_SetOrigin, ent, origin)
set_pev(ent, pev_solid, SOLID_SLIDEBOX)
set_pev(ent, pev_movetype, MOVETYPE_TOSS)
set_pev(ent, pev_owner, id)
static Float:global_Time
global_get(glb_time, global_Time)
set_pev(ent, pev_nextthink, global_Time + 1.0)
}
PHP Code:
RegisterHam(Ham_Touch, "info_target", "touched", 1)
But not works. I see my entity, but no action when I touch it. Why ?
__________________