Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

2 years ago

Advertisement
October 15, 2019, 08:56:47 am

Author Topic: What script includes the /tpm command?  (Read 2088 times)

PixelizedGamer

  • Newbie
  • *
  • Posts: 1
    • View Profile
What script includes the /tpm command?
« on: June 12, 2015, 09:29:14 pm »
I have looked everywhere and can't find a script that includes the /tpm command.

The command works like this. You press F6(part of the playerlist default script) and find the player you wish to teleport to. You look at their ID (ex. '61'), and teleport to them using their ID after /tpm (ex. "/tpm 61").

Does anyone have any ideas what script this is, or at least a script that is close to this one?

Thanks in advance.

bobsayshilol

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: What script includes the /tpm command?
« Reply #1 on: June 14, 2015, 06:29:26 pm »
The /tpm command isn't a default, but one I made in a rush in the first few days of this mods existence. I'd heavily recommend using something like this instead.

If you insist on having the /tpm command then here's the latest version I can find on my computer (cleaned up a bit, although untested):
Code: [Select]
local textColor = Color.Red

OnPlayerChat = function(args)
    if args.text:sub(1,4) == "/tpm" then
        local tester = args.player:GetSteamId()
        local nameLook = args.text:sub(6)
        if nameLook and nameLook ~= "" then
            if tonumber(nameLook) and Player.GetById(tonumber(nameLook)) then
                local pFound = Player.GetById(tonumber(nameLook))
                local newPos = pFound:GetPosition()
                args.player:SetPosition(newPos)
                args.player:SendChatMessage("Teleporting to " .. pFound:GetName(), textColor)
            else
                args.player:SendChatMessage("Couldn't find anyone with id " .. nameLook, textColor)
                args.player:SendChatMessage("Press F6 to find out their id", textColor)
            end
        else
            args.player:SendChatMessage("Usage:", textColor)
            args.player:SendChatMessage("  /tpm <playerID>", textColor)
            args.player:SendChatMessage("Where playerID is their ID. To find out their ID", textColor)
            args.player:SendChatMessage("press F6 and use the search box at the bottom.", textColor)
        end
        return false
    else
        return true
    end
end

Events:Subscribe("PlayerChat", OnPlayerChat)
Just save that to scripts/tpm/server/tpm.lua (I think)

Also I know that a lot of servers have come to use /tpm because people know it from the N3 server, and I want to apologise to everyone that's been affected by that - if I'd known how popular the N3 server was going to be I'd have added it to /tp or given it a better name (it was originally just for mods/admins and stood for "teleport me", but that's just useless history now :P ).

Garmelon

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: What script includes the /tpm command?
« Reply #2 on: July 18, 2015, 02:07:29 pm »
One thing to note is that the above script does not include tpm toggling ("/tpm toggle").

adam1305_

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
Re: What script includes the /tpm command?
« Reply #3 on: July 19, 2015, 04:40:40 pm »
Garmelon's Helferein2 uses /tpm. It is a rank/role script with admin commands and many more :)  I use it on my server since I am friends with Garmelon :D


https://github.com/Garmelon/Helferlein2

Garmelon

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: What script includes the /tpm command?
« Reply #4 on: July 20, 2015, 08:14:02 pm »
It's not really user friendly and not really finished though :P