EDIT:
Fixed this by setting the model after I set the origin (which makes me assume you have to set the size first before the model).
----------------
I'm trying to spawn an entity that will interact with a player. It's working fine but there are a few problems I will mention below.
PHP Code:
new Float:origin[3], Float:mins[3], Float:maxs[3];
// It seems if I change the mins values any lower I can't interact?
mins = Float:{-15.0, -15.0, -36.0};
maxs = Float:{15.0, 15.0, 36.0};
pev(id, pev_origin, origin);
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
engfunc(EngFunc_SetModel, ent, "some_model");
engfunc(EngFunc_SetSize, ent, mins, maxs);
engfunc(EngFunc_SetOrigin, ent, origin);
set_pev(ent, pev_angles, angles);
set_pev(ent, pev_solid, SOLID_TRIGGER);
set_pev(ent, pev_movetype, MOVETYPE_NONE);
set_pev(ent, pev_classname, "some_classname");
set_pev(ent, pev_skin, 2);
set_pev(ent, pev_sequence, 1);
set_pev(ent, pev_framerate, 1.0);
// If I don't droptofloor I can't interact?
engfunc(EngFunc_DropToFloor, ent);
I added comments to the spots that were causing problems.
Why would making the mins/maxs any smaller than what it is make it so I can't interact with the entity? Also, why if I don't drop the entity to the floor will it not let me interact?
I'm coding this for Counter-Strike, and when I was working with Team Fortress Classic I never had a problem like this. If someone knows what is going on please let me know.