View Single Post
  #7  
Old 06-14-2013, 05:58 AM
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
Quote:
Originally Posted by fowlplay4 View Post
PHP Code:
    temp.pl player;
    
temp.warped findplayer2(params[1]);
    if (
temp.warped != NULL) {
      
temp.pl.setlevel2(temp.warped.leveltemp.warped.xtemp.warped.y);
    } else {
      
temp.pl.chat "Can't find" SPC params[1];
    }
  } 
Also, there's no reason to store the player object in a temporary variable—it's just confusing to anybody reading the script (as are the variable names you (khortez) used). The current player will remain in scope.

PHP Code:
    temp.pl findplayer2(params[1]);
    if (
temp.pl != NULL) {
      
player.setlevel2(temp.pl.leveltemp.pl.xtemp.pl.y);
    } else {
      
player.chat "Can't find" SPC params[1];
    }
  } 
__________________

Last edited by cbk1994; 06-14-2013 at 07:42 AM..
Reply With Quote