View Single Post
  #4  
Old 06-24-2011, 06:21 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
There's a couple problems, but the main one is you're using it wrong. It's not returning a string of accounts, it's returning an array of players. The only reason tokenizing it works is because it's being coerced into a string of comma-separated accounts.

Try this instead:

PHP Code:
temp.closePlayers findNearestPlayers(temp.xtemp.y);
temp.playerToHit null;

for (
temp.closePlayer temp.closePlayers) {
  if (
temp.closePlayer == player) {
    continue; 
// can't hit yourself
  
}
  
  
temp.playerToHit temp.closePlayer;

Then you can use temp.playerToHit which is a player object of the closest player.
__________________
Reply With Quote