View Single Post
  #8  
Old 12-13-2006, 09:29 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I've had problems with test player so I made my own function

PHP Code:
function findNearestPlayers(fx,fy,dist)
{
  for (
pl players)
  {
    if (
pl.x in |fx-dist,fx+dist|)
    {
      if (
pl.y in |fy-dist,fy+dist|)
      {
        return 
pl;
      }
    }
  }

You can edit it to make it add all accounts into an array or make it return an account name instead of an object =p.

You could also change it to look for players in a square area instead of a circle.
Reply With Quote