AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity Interaction Problem (https://forums.alliedmods.net/showthread.php?t=62776)

hlstriker 11-04-2007 17:09

Entity Interaction Problem
 
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.015.036.0};

pev(idpev_originorigin);

new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
engfunc(EngFunc_SetModelent"some_model");
engfunc(EngFunc_SetSizeentminsmaxs);
engfunc(EngFunc_SetOriginentorigin);
set_pev(entpev_anglesangles);
set_pev(entpev_solidSOLID_TRIGGER);
set_pev(entpev_movetypeMOVETYPE_NONE);
set_pev(entpev_classname"some_classname");
set_pev(entpev_skin2);
set_pev(entpev_sequence1);
set_pev(entpev_framerate1.0);

// If I don't droptofloor I can't interact?
engfunc(EngFunc_DropToFloorent); 

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.

[ --<-@ ] Black Rose 11-04-2007 21:48

Re: Entity Interaction Problem
 
You do know that you missed a " ?

hlstriker 11-04-2007 21:52

Re: Entity Interaction Problem
 
Nope I didn't know that. That isn't the problem though sadly, lol :(

hlstriker 11-06-2007 13:36

Re: Entity Interaction Problem
 
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).


All times are GMT -4. The time now is 01:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.