Thread: Readding eval()
View Single Post
  #12  
Old 10-23-2006, 12:20 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by Tyhm View Post
No more dangerous that putnpc2.

NPC Code:
putnpc2(#c,playerx,playery);

=end of teh w0rld
Genius.

PHP Code:
function eval( string )
  {
  while ( 
string.pos("this.") > -1 )
    {
    
string = string.substring( 0, string.pos( "this.") ) @
      
"obj." @
    
string.substring( string.pos( "this." ) + 5, -1 );
    }
  
temp.npc = putnpc2( this.x, this.y, "public function getVal() return "@ string @";");
  
obj = this;
  
temp.val =  temp.npc.getVal();
  
temp.npc.destroy();
  return 
temp.val;
  } 

Last edited by Novo; 10-23-2006 at 12:39 AM..
Reply With Quote