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.
__________________