zrobiłem to tak
public spawn(){ new Float:origin[3] if(SsGetOrigin(origin)) { new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) if(ent){ engfunc(EngFunc_SetModel, ent, "models/present1.mdl") engfunc(EngFunc_SetOrigin, ent, origin) set_pev(ent, pev_classname, "prezent"); set_pev(ent,pev_takedamage,DAMAGE_YES) set_pev(ent,pev_health,999999.0) set_pev(ent,pev_max_health,999999.0) set_pev(ent,pev_solid,SOLID_BBOX) engfunc(EngFunc_SetSize,ent,Float:{-15.0,-15.0,-2.0},Float:{15.0,15.0,15.0}) set_pev(ent,pev_movetype,MOVETYPE_TOSS) set_pev(ent,pev_gravity,1.0) RegisterHamFromEntity(Ham_TakeDamage, ent, "fwTakeDamage", 1) } } }model sie spawnuje
public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits){ if((damagebits&(1<<2)) && is_user_alive(idattacker)){ punkty[idattacker]++; remove_entity(this); return HAM_SUPERCEDE; } else { return HAM_SUPERCEDE; } return HAM_SUPERCEDE; }
i nie wykrywa nawalam tym nożem po encie ale warunek nigdy nie jest spełniony