Thread: New accounts
View Single Post
  #96  
Old 05-28-2008, 04:21 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
Quote:
Originally Posted by Chompy View Post
PHP Code:
function checkPlayer(plyr) {
  
temp.findplayer(plyr);
  if (
== 0findplayerbycommunityname(plyr);
  if (
== 0) return 0;
  return 
1;

Jesus chompy what are you doing to me man, you scared the crap out of me.

Before you edited your post I had this in the quick reply box:

PHP Code:
function _getPlayer(pl) {
  
temp.findplayerbycommunityname(pl);
  if (
temp.== 0) {
    
temp.findplayer(pl);
    if (
temp.== 0) {
      return 
0;
    } else {
      return 
temp.p;
    }
  } else {
    return 
temp.p;
  }

[EDIT]
Actually that can probably be optimised:

PHP Code:
function _getPlayer(pl) {
  
temp.findplayerbycommunityname(pl);
  return 
== findplayer(pl) : p;

[/EDIT]
__________________