tworze enta za pomoca fakemety w ten sposob
public fwd_CmdStart(id, uc_handle, seed) { if(!is_user_alive(id) || g_flLastRpgAttack[id]>get_gametime()) return; if(get_uc(uc_handle,UC_Buttons) & IN_ATTACK2 && get_user_weapon(id) == CSW_KNIFE) { static ent,Float:fOrigin[3],Float:fSpeed[3] client_print(id,3,"Wystrzal z RPG") g_flLastRpgAttack[id]=get_gametime()+2.0 velocity_by_aim(id,500,fSpeed) pev(id,pev_origin,fOrigin) ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")) set_pev(ent,pev_classname,"rpgrocket") set_pev(ent,pev_model,"models/rpgrocket.mdl") set_pev(ent,pev_origin,fOrigin) set_pev(ent,pev_movetype,MOVETYPE_NOCLIP) set_pev(ent,pev_solid,SOLID_BBOX) set_pev(ent,pev_velocity,fSpeed) set_pev(ent,pev_owner,id) } }
i klapa enta nie ma ale jak zrobie dokladnie to samo przy pomocy engine
public fwd_CmdStart(id, uc_handle, seed) { if(!is_user_alive(id) || g_flLastRpgAttack[id]>get_gametime()) return; if(get_uc(uc_handle,UC_Buttons) & IN_ATTACK2 && get_user_weapon(id) == CSW_KNIFE) { static ent,Float:fOrigin[3],Float:fSpeed[3] client_print(id,3,"Wystrzal z RPG") g_flLastRpgAttack[id]=get_gametime()+2.0 velocity_by_aim(id,500,fSpeed) entity_get_vector(id,EV_VEC_origin,fOrigin) ent = create_entity("info_target") entity_set_string(ent,EV_SZ_classname,"rpgrocket") entity_set_model(ent,"models/rpgrocket.mdl") entity_set_vector(ent,EV_VEC_origin,fOrigin) entity_set_int(ent,EV_INT_movetype,MOVETYPE_NOCLIP) entity_set_int(ent,EV_INT_solid,SOLID_BBOX) entity_set_vector(ent,EV_VEC_velocity,fSpeed) entity_set_edict(ent,EV_ENT_owner,id) } }
wszystko dziala jak nalezy wiec gdzie robie blad?