PHP Code:
function onNPC(checkx, checky, checkw, checkh) {
temp.npclist = getnearestnpcs(checkx,checky);
for(temp.npclist: temp.npc) {
if(temp.npc.x in |checkx,checkx+checkw| && test.npc.y in |checky,checky+checkh|) {
return true;
}
}
return false;
}
Whatever, I just scripted that in the thirty seconds that I've been sitting here staring at this thread. If it doesn't work, oh well, but that sounds like what you're trying to do. If you want to modify it to return the indexes or whatever, go ahead.