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);
}