so you want to point a sprite to some xy coords?
function pointsprite(s,x,y)
dx = sprite x(s) - x
dy = sprite y(s) - y
ang# = wrapvalue(atanfull(dx,dy)*-1)
rotate sprite s,ang#
endfunction
sorry for basic code, can be easily translated to C++, i found it after a quick search for "point sprite"
i think the c++ code should look like
void PointSprite ( int spriteID, int x, int y )
{
int dx = dbSpriteX(spriteId) - x;
int dy = dbSpriteY(spriteID) - y;
int ang = dbWrapValue(dbAtanfull(dx,dy)*-1);
dbRotateSprite( spriteID, ang );
}