04-15-2013, 03:12 AM
04-15-2013, 03:52 AM
(04-15-2013, 03:12 AM)STR_Warrior Wrote: [ -> ]maybe you can also add a /tpahere and a /tprefuse.Ok, I will see what I can do. Remember that I started with Lua today so I'm a noob.
I'll investigate the code you write and I'll try to add /tpahere
04-15-2013, 03:58 AM
well it should be pretty easy (i think.) just change the Destination[Player].
EDIT
nevermind that won't work. you would then just teleport to yourself ;P
EDIT
nevermind that won't work. you would then just teleport to yourself ;P
04-15-2013, 04:45 AM
(04-15-2013, 03:58 AM)STR_Warrior Wrote: [ -> ]well it should be pretty easy (i think.) just change the Destination[Player].I did it, I added /tpahere and /tpahereaccept. I thing there is a bug. To test it, I have 2 minecraft windows open, my account tonibm and test. When test send a tpahere request to tonibm, with /tpahereaccept tonibm is teleported to test. But if tonibm sends a tpahere request to test, and then test types /tpahereaccept, nothing happen.
EDIT
nevermind that won't work. you would then just teleport to yourself ;P
04-15-2013, 04:46 AM
does "test" has the right permissions?
04-15-2013, 04:49 AM
(04-15-2013, 04:46 AM)STR_Warrior Wrote: [ -> ]does "test" has the right permissions?Yes, it's in Admin
But It don't say "Unknow command", only that nothing happen.
04-15-2013, 04:52 AM
could you post the code again?
and if you do it in

this form it would be easier to see whats wrong
04-15-2013, 04:54 AM
(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]
04-15-2013, 05:12 AM
well since i can't find the problem by looking at it i'l have to try it myself :S
lol it seems like there is no need for a /tpahereaccept command becouse /tpaccept works fine for me both with /tpa and /tpahere.
EDIT:
Nope was mistaken.. :S
lol it seems like there is no need for a /tpahereaccept command becouse /tpaccept works fine for me both with /tpa and /tpahere.
EDIT:
Nope was mistaken.. :S
04-16-2013, 05:01 AM
(04-15-2013, 05:12 AM)STR_Warrior Wrote: [ -> ]well since i can't find the problem by looking at it i'l have to try it myself :Sfor me, if you type /tpaccept, it's like /tpa, no /tpahere. You have to type /tpahereaccept.
lol it seems like there is no need for a /tpahereaccept command becouse /tpaccept works fine for me both with /tpa and /tpahere.
EDIT:
Nope was mistaken.. :S
But I have all /tpa commands in the same lua