hello guys,
i try to spawn a info_target with a model but the i cant see the model then i type /a..
PHP Code:
public lol(id)
{
new origin[3]
get_user_origin(id, origin, 0)
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if(!pev_valid(ent)) return 0
engfunc(EngFunc_SetModel, ent, "models\akirby.mdl")
engfunc(EngFunc_SetOrigin, ent, origin)
return PLUGIN_CONTINUE
}
my second question is: How can i set a classname? I need it, because i wanna do something when the player touches the model...
Edit. I also tried this version:
PHP Code:
new const classname[] = "kirby"
new const model[] = "models/akirby.mdl"
new float:origin[3]
get_user_origin(id, origin, 0)
new iKirby = create_entity("info_target")
if(!is_valid_ent(iKirby))
return PLUGIN_CONTINUE;
entity_set_string( iKirby, EV_SZ_classname, classname);
entity_set_int( iKirby, EV_INT_solid, SOLID_TRIGGER );
entity_set_vector( iKirby, EV_VEC_origin, origin);
entity_set_model( iKirby, model);
return PLUGIN_CONTINUE;
public plugin_precache()
precache_model(model)
but the model also dont spawn...
__________________