View Single Post
  #8  
Old 12-29-2011, 05:48 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
Quote:
Originally Posted by Gunderak View Post
PHP Code:
  temp.lname player.level.name.substring(6);
  
temp.lname lname.substring(0lname.pos(".nw").trim());
  
//had to use it twice, I tried  player.level.name.substring(6,  lname.pos(".nw").trim());  with no luck. 
That's because the second parameter is the length to cut, not the index of the last character to cut.

PHP Code:
temp.account player.level.name.substring(6player.level.name.length() - 9); 
That should work.

Why are you trimming the position of ".nw"? It doesn't make any sense to trim output from a function which always returns integers.
__________________
Reply With Quote