View Single Post
  #3  
Old 01-14-2008, 10:13 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
findplayer() will work no matter what, but only on account names. If you want to make something that is more friendly to the players, generally you would go with findplayerbycommunityname(). Keep in mind, though, that this will not work for players who have not yet set a community name.

Nowadays, it is good to use both. For example, I found that with text-based commands, it is sometimes hard to go searching for the actual account name. Here's a function that allows you to use the 'account' that you see in the profile of the player:

PHP Code:
function findplayer2(p) {
  
temp.result findplayer(temp.p);
  return (
temp.result != null) ? temp.result findplayerbycommunityname(temp.p);

__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote