View Single Post
  #1  
Old 08-25-2011, 03:56 PM
Ignorance
Fire Beetle
 
Join Date: Jun 2006
Location: baconland
Posts: 14
Default

@trevius
Thanks.
$ent->MovePC( zone_id, x, y, z, 0 ) worked for me.

Here is the actual code I used...
Code:
$clientx = 0; $clienty = 0; $clientz = 0;
@clientlist = $entity_list->GetClientList();
foreach $ent (@clientlist)
{
  $playerx = $ent->GetX();
  $playery = $ent->GetY();
  $playerz = $ent->GetZ();
  if( $playerx >= $LocationX1List[$locationNumber] && $playerx <= $LocationX2List[$locationNumber] )
  {
  if( $playery >= $LocationY1List[$locationNumber] && $playery <= $LocationY2List[$locationNumber] )
  {
  if( $playerz >= $LocationZ1List[$locationNumber] && $playerz <= $LocationZ2List[$locationNumber] )
  {
  # Client is within the boundries
    $ent->MovePC( 96, 4366.94, -12256.9, -265, 0 );
  }
  }
  }
}
I just do a simple bounding box check instead of a vector magnitude calculation.
Now that the code works, I have to port it back to template form.
I think I'll have to post the code for anyone who's interested.
Reply With Quote