1. Hello, do you know Lua?
    Well if you do can you please start a convocation with me, I have a bit of code that I need changing, its to allow people to cancel there TP after accepted, but one line of code isn't working :). So please message me if you can help :p

    This code
    self:SendMessage( originPlayer, "4")
    (and)
    self:SendMessage( originPlayer, "6")
    (Don't Work)

    Code:
    function PLUGIN: cmdTeleportCancel( player, cmd)    local playerID = rust.UserIDFromPlayer( player )
        if PendingRequests[playerID] then
            local originPlayerID = rust.UserIDFromPlayer( originPlayer )
            local originPlayer   = PlayersRequests[playerID]
            self:SendMessage( originPlayer, "1")
            self:SendMessage( player, "2")
            PendingRequests[playerID]:Destroy()
            PendingRequests[playerID] = nil
            PlayersRequests[playerID] = nil
            PlayersRequests[originPlayerID] = nil
        end
        if TeleportTimers[playerID] then
            self:SendMessage( player, "3")
            self:SendMessage( originPlayer, "4")
            TeleportTimers[playerID].timer:Destroy()
            TeleportTimers[playerID] = nil
        end
     
        if TeleportTimers[originPlayerID] then
            self:SendMessage( player, "5")
            self:SendMessage( originPlayer, "6")
            TeleportTimers[originPlayerID].timer:Destroy()
            TeleportTimers[originPlayerID] = nil
        end
    end
    Once it is done, I shall let the public have the code for other server owners to use :)

    The Numbers are just to test for if the code works :)
     
    Last edited by a moderator: Apr 7, 2016
  2. Best to post what you have so all can help
     
  3. Ok Sure :))))))))))))
    [DOUBLEPOST=1459984605][/DOUBLEPOST]Go wild my children!
    [DOUBLEPOST=1459984780][/DOUBLEPOST]With all respects, if you find a fix for this code. Please comment it back in the room so othere people can enjoy it.
     
  4. Can't wait till m-Teleporation is ported into C# :D, try overriding plugins.CallHook( "CanTeleport", arr ) when the player tries to cancel it. Just a option I guess, im not the best with lua as me myself I ported over to C# :)
     
  5. I don't even get an error with this XD. Just dose not want to send it...
     
  6. Ah, I got it straight from the plugin itself so it might need a few more args or something. I could do a lot more if this was C# be hasn't ported it yet *Cough cough* xD