04-15-2013, 12:13 AM
(04-15-2013, 12:04 AM)STR_Warrior Wrote: i have an idea but i'm not sure if it works with the code you made. could you post it withThe code it's based on teleport.lua, it's very similar.?Code:[shcode=lua]CODE HERE[/shcode]
Code:
function HandleTPACommand( Split, Player )
if( Split[2] == nil ) then
Player:SendMessage( cChatColor.Green .. "Usage: /tpa [PlayerName] (-h)" )
return true
end
local TeleportDestination = function(OtherPlayer)
if( OtherPlayer == Player ) then
Player:SendMessage( cChatColor.Green .. "Already there :)" )
else
Player:SendMessage( cChatColor.Green .. "Teleport request sent" )
OtherPlayer:SendMessage( cChatColor.Green .. Player:GetName().." has sent you a teleport request, type /tpaccept to accept it" )
end
end
World = Player:GetWorld()
if (not(World:DoWithPlayer(Split[2], TeleportDestination))) then
Player:SendMessage( cChatColor.Green .. "Can't find player " .. Split[2] )
end
return true
end