Blockland Forums > Modification Help

Teleporting A Player To Another Player

Pages: << < (2/4) > >>

Chrono:

Ahaha, so many random brackets tossed in that I got confused.

Yeah heed is right. In fact, that's the only part you actually need, you don't need the second one. (if(!isObject(%targetOne) || etc...)

Brian Smithers:


$TPAdminOnly = true;
function serverCmdTP(%client,%one,%two)
{
   if($TPAdminOnly == true && %client.isAdmin == false)
      return;
   %one = findclientbyname(%one);
   %two = findcientbyname(%two);
   if(!isObject(%one) || !isObject(%one.player))
      return;
   if(!isObject(%two) || !isObject(%two.player))
      return;
   %one.player.setTransform(%two.player.getPosition());
}

I though this would be much neater, if you do one player at a time.


Chrono:

Why in the world would you even consider having a toggle for admin only on this?

You also need to do .getTransform() for the %two or else %one will always be facing north. (I think, at most I know it'll be facing 0 0 0)

Mr.jacksaunt:


--- Quote from: Brian Smithers on February 14, 2012, 03:17:34 PM ---
$TPAdminOnly = true;
function serverCmdTP(%client,%one,%two)
{
   if($TPAdminOnly == true && %client.isAdmin == false)
      return;
   %one = findclientbyname(%one);
   %two = findcientbyname(%two);
   if(!isObject(%one) || !isObject(%one.player))
      return;
   if(!isObject(%two) || !isObject(%two.player))
      return;
   %one.setTransform(%two.getPosition());
}

I though this would be much neater, if you do one player at a time.


--- End quote ---
Brian
That was your 666th post

otto-san:


--- Quote from: Brian Smithers on February 14, 2012, 03:17:34 PM ---
$TPAdminOnly = true;
function serverCmdTP(%client,%one,%two)
{
   if($TPAdminOnly == true && %client.isAdmin == false)
      return;
   %one = findclientbyname(%one);
   %two = findcientbyname(%two);
   if(!isObject(%one) || !isObject(%one.player))
      return;
   if(!isObject(%two) || !isObject(%two.player))
      return;
   %one.setTransform(%two.getPosition());
}

I though this would be much neater, if you do one player at a time.


--- End quote ---
I don't think that will work. Clients don't have a transform or position.

Pages: << < (2/4) > >>

Go to full version