Plugin developement
#28
(04-15-2013, 04:52 AM)STR_Warrior Wrote: could you post the code again? Wink 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]
Reply
Thanks given by:


Messages In This Thread
Plugin developement - by tonibm19 - 04-14-2013, 10:00 PM
RE: Plugin developement - by NiLSPACE - 04-14-2013, 10:08 PM
RE: Plugin developement - by tonibm19 - 04-14-2013, 10:23 PM
RE: Plugin developement - by NiLSPACE - 04-14-2013, 10:29 PM
RE: Plugin developement - by tonibm19 - 04-14-2013, 10:34 PM
RE: Plugin developement - by NiLSPACE - 04-14-2013, 10:42 PM
RE: Plugin developement - by FakeTruth - 04-14-2013, 10:49 PM
RE: Plugin developement - by tonibm19 - 04-14-2013, 11:41 PM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 12:04 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 12:13 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 12:33 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 12:43 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 12:44 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 12:46 AM
RE: Plugin developement - by FakeTruth - 04-15-2013, 12:46 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 12:47 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 12:49 AM
RE: Plugin developement - by FakeTruth - 04-15-2013, 12:45 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 12:53 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 12:54 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 03:12 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 03:52 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 03:58 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 04:45 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 04:46 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 04:49 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 04:52 AM
RE: Plugin developement - by tonibm19 - 04-15-2013, 04:54 AM
RE: Plugin developement - by NiLSPACE - 04-15-2013, 05:12 AM
RE: Plugin developement - by tonibm19 - 04-16-2013, 05:01 AM



Users browsing this thread: 11 Guest(s)