(04-15-2013, 04:52 AM)STR_Warrior Wrote: could you post the code again?and if you do it in
this form it would be easier to see whats wrong
function HandleTPAHERECommand( Split, Player )
if Split[2] == nil then
Player:SendMessage( cChatColor.Green .. "Usage: /tpahere [Player]" )
return true
end
local loopPlayer = function( OtherPlayer )
if OtherPlayer:GetName() == Split[2] then
OtherPlayer:SendMessage( cChatColor.Green .. Player:GetName() .. " send a teleport request to you" )
Player:SendMessage( cChatColor.Green .. "You send a teleport request to " .. OtherPlayer:GetName() )
Destination[OtherPlayer:GetName()] = Player:GetName()
end
end
local loopWorlds = function( World )
World:ForEachPlayer( loopPlayer )
end
cRoot:Get():ForEachWorld( loopWorlds )
return true
end
function HandleTPAHerecceptCommand( Split, Player )
if Destination[Player:GetName()] == nil then
Player:SendMessage( cChatColor.Green .. "Nobody has send you a teleport request" )
return true
end
local loopPlayer = function( OtherPlayer )
if Destination[OtherPlayer:GetName()] == Player:GetName() then
if OtherPlayer:GetWorld():GetName() ~= Player:GetWorld():GetName() then
OtherPlayer:MoveToWorld( Player:GetWorld():GetName() )
end
Player:TeleportToEntity( OtherPlayer )
Player:SendMessage( cChatColor.Green .. OtherPlayer:GetName() .. " teleported to you" )
OtherPlayer:SendMessage( cChatColor.Green .. "You teleported to " .. Player:GetName() )
Destination[Player:GetName()] = nil
end
end
local loopWorlds = function( World )
World:ForEachPlayer( loopPlayer )
end
cRoot:Get():ForEachWorld( loopWorlds )
return true
end
EDIT FakeTruth:
He means use
Code:
[shcode=lua]code here inside SHcode tags, not regular code tags. sh stands for Syntax Highlighted or something :D[/shcode]

and if you do it in