Raised This Month: $ Target: $400
 0% 

Odd Entity Problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-13-2009 , 14:44   Re: Odd Entity Problem
Reply With Quote #5

The engfunc worked perfectly, but it still bothers me that I don't understand it completely!

Here's the order everything went in on both.

One that already worked:
PHP Code:
new Item=engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))

new 
Float:Location[3]
pev(id,pev_origin,Location)

new 
Float:Minbox[3]={-2.5,-2.5,-2.5}
new 
Float:Maxbox[3]={2.5,2.5,-2.5}
new 
Float:Angles[3]//={0.0,0.0,0.0}

Angles[1]=float(random_num(0,359)) 

set_pev(Item,pev_mins,Minbox)
set_pev(Item,pev_maxs,Maxbox)
set_pev(Item,pev_angles,Angles)            
set_pev(Item,pev_solid,SOLID_TRIGGER)
set_pev(Item,pev_movetype,MOVETYPE_TOSS)            
set_pev(Item,pev_classname,CLASS_ITEM)

new 
String[65]
format(String,64,"Stuff")
set_pev(Item,pev_targetname,String)

format(String,64,"Modelpath")
engfunc(EngFunc_SetModel,Item,String)
set_pev(Item,pev_origin,Location
What you just helped with:
PHP Code:
//I passed some coordinates through to the threaded query
new Float:Origin[3]
for(new 
i=0;i<3;i++)
        
Origin[i]=float(Data[i])

new 
Float:Angles[3]
for(new 
i=0;i<3;i++)
        
Angles[i]=float(Data[i+3])

entity=engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
        
set_pev(entity,pev_angles,Angles)        
set_pev(entity,pev_solid,SOLID_NOT)
set_pev(entity,pev_movetype,MOVETYPE_NONE)        
set_pev(entity,CLASS_SALEITEM)

format(Model,64,"Modelpath",Model)
engfunc(EngFunc_SetModel,entity,Model)

engfunc(EngFunc_SetOrigin,entity,Origin
So I guess the second one was created differently in the engine because it was not solid and had no min/maxbox? Otherwise, I think everything else was done in the same order.
__________________
Bad_Bud is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:08.


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