You could look at the /tp command in the Core plugin, as it takes a player name as its first argument (/tp [playername])
Code:
function HandleTPCommand( Split, Player )
if( not Player:HasPermission( "core.teleport" ) ) then
return false
end
local Server = cRoot:Get():GetServer()
if( #Split ~= 2 ) then
Server:SendMessage( cChatColor.Green .. "Usage: /tp [PlayerName]", Player )
return true
end
local World = cRoot:Get():GetWorld()
local OtherPlayer = World:GetPlayer( Split[2] )
if( OtherPlayer == nil ) then
Server:SendMessage( cChatColor.Green .. "Can't find player " .. Split[2], Player )
elseif( OtherPlayer == Player ) then
Server:SendMessage( cChatColor.Green .. "Already there :)", Player )
else
Player:TeleportTo( OtherPlayer )
Server:SendMessage( cChatColor.Green .. "You teleported to "..OtherPlayer:GetName().."!", Player )
Server:SendMessage( cChatColor.Green .. Player:GetName().." teleported to you!", OtherPlayer )
end
return true
end