Hey. When I spawn an object with this function:
void Create_NPC ( int health, int xpos, int ypos, int zpos, int yeait )
{
npcs[npcnum][0] = npcmodel;
npcs[npcnum][1] = health;
npcs[npcnum][2] = xpos;
npcs[npcnum][3] = ypos;
npcs[npcnum][4] = zpos;
npcs[npcnum][5] = yeait;
dbLoadObject ( "tiger.x", npcmodel );
dbPositionObject( npcmodel, xpos, ypos, zpos );
npcmodel++;
npcnum++;
}
Then when I try to get it's Object ID with this function:
if ( dbMouseClick() == 1 )
{
int selobj = dbPickObject(dbMouseX(),dbMouseY(),1,10);
char stuff21 [ 256 ] = "Object ID = ";
strcat ( stuff21, dbStr ( selobj ) );
dbText ( 0, 50, stuff21 );
if ( selobj <= 500 && selobj >= 1000 )
{
do
{
int i = 0;
int curi = i;
if ( npcs[i][0] = selobj )
{
int selh = npcs[i][1];
char stuff20 [ 256 ] = "NPC Health = ";
strcat ( stuff20, dbStr ( selh ) );
dbText ( 0, 60, stuff20 );
}
i++;
} while (npcs[curi][0] != selobj);
}
}
It does not return a value, it just acts like the object is not there and returns the object that is behind it.
Whats going on?