[Req] Random TP (/patrol)

Discussion in 'Archived: Plugin Requests' started by Cypiditas, Jun 22, 2011.

  1. Offline

    Cypiditas

    On my classic server, there was a command that tp'd you to random people (/patrol). It would teleport you to a random player, essentialy going through all the online people before going back to the first person you randomly tp'd to. It was really helpfull because it helped catch griefers without having to type out bizzare names, like superg20oI235i32. Well now I moderate a SMP with the towny plugin, and we are starting to get a lot of x ray mod/texture pack users. We have tryed to use an anti - xray plugin, but it conflicted with something and caused itself to use up 16gb of our server's memory.

    So if it hasnt been done already, it would be awesome if a plugin was made to be able to tp to random people using a command. If it has already been done, could someone supply me with a link? If it hasnt, it would be great if someone could make it. It would need to include the ability to add permissions, as we only want Mods and admins being able to use it.

    Thanks a lot,
    Cyp
     
  2. Offline

    Celeo

    Do you want the command to teleport you to a random person every time you type it, or have it cycle through with teleports automatically until the mod/admin has seen everyone?
     
  3. Offline

    Cypiditas

    Teleport to a random person every time you type it in. So if there was 25 people on, youd need to type /patrol 25 times to see every person.
     
  4. Offline

    Celeo

    Ok, I think that I could do that for you. :)
     
  5. Offline

    Cypiditas

    Sweet! Thanks a lot ^^
     
  6. Offline

    Celeo

    My pleasure. :)

    Plugin completed. It uses the /patrol command to send you to a random person.

    Download: http://dl.dropbox.com/u/11962432/ServerPatrol.jar
    Source Code (if you are interested): https://github.com/Celeo/ServerPatrol

    As it stands, upon first use of the command, the plugin will create a list of players currently online. It will then teleport you to the first person in the list, and then remove the person. That way, you will never visit the same person before visiting everyone else. When you have visited everyone on the server when the list was created, it will create a new list with the people online at that time and the process will continue as many times as you issue the /patrol command. The Permissions node is 'server.patrol'.

    Enjoy, and let me know if there is anything that you want added, like a message when you teleport telling who you are teleporting to or anything like that.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  7. Offline

    Cypiditas

    Ok, we have it on our server, weve done a reload, and server restart. But for some reason it keeps say Unknown Server console command.
     
  8. Offline

    Celeo

    Oh! I did not know that you wanted the command to be issued from the console. If so, I can make the change. The command would then have to be "/patrol [name of mod/admin]." if that is what you want, then I will make the change tomorrow.

    (Currently, the /patrol command can only be issued by someone with the Permission node or someone who is an OP).
     
  9. Offline

    Cypiditas

    Would it be possible to keep both versions available? We are currently using Groupmanager, but we plan on switching to permissions very soon.
     
  10. Offline

    Celeo

    Sure, I'll make the edits today.

    Version 1.1 Released.
    Download: http://dl.dropbox.com/u/11962432/ServerPatrol.jar
    You can now issue the /patrol command from someone with the Permissions node 'server.patrol' OR someone who is an OP if Permissions is not detected OR by the console.

    From the console, the command is /patrol [mod/admin]. From the game, it is still just /patrol.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  11. Offline

    Cypiditas

    Thank you very much! It works great :D
     
  12. Offline

    Celeo

    I'm glad that you like it! Enjoy!
     
  13. Offline

    Shigan

    Celeo, if you wouldn't mind, can you please add some comments to your source code? I am currently trying to learn Bukkit Java programming, but I am having some difficulty. Being able to actually see what the code does would make things much, much easier on me.
     
  14. Offline

    Celeo

    I sure will. :) It'll be done by tomorrow, late morning.
     
  15. Offline

    Shigan

    Alright, thanks a lot
     
  16. Offline

    Celeo

  17. Offline

    Shigan

    Thanks Celeo, I appreciate it
     
  18. Offline

    Celeo

    Sure, I'm glad to help. One of the things about being a plugin designer is that I am often limited in plugins to make due to a lack of ideas. So when someone provides me with an idea for a plugin to make, I am quite happy as coding is something that I very much enjoy. So it is like a trade: someone gives me an idea, making me happy, and then I produce for them the plugin, which makes them happy.

    Nice to do business with you. :)
     

Share This Page