1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Send to hub a player when logs in specific area

Discussion in 'Development' started by LordJoshie, Feb 17, 2017.

  1. LordJoshie

    LordJoshie Silverfish

    Messages:
    22
    GitHub:
    lordjoshie
    I'm looking to setup a way to send a player to hub when they log into a world in a specific area.

    I have my server setup so when you vote, you teleport to an area, select a reward, and then it teleports you back to where you were.... however, when you logout/backin from that area, and select a reward, it doesn't make you leave the area, and you can keep selecting rewards.

    Anyone have any ideas ? ... I have two areas, one in the same world as my spawn, and one in another world on its own.
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You could store the coordinates for the corners of the area, then compare the player's coordinates when they join to those two to see if they are in the area or not. If they are, you could teleport them to the world spawn. You can store the coordinates for each world, then compare them to the coordinates of the player by also checking what level they are in.
     
  3. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    I have that doubt too, can u explain more with a simple example? Like how to implement it :)
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you shouldnt use that kind of setup since player can glitch to the reward place thus giving them indefinite rewards you should just +1 to the player config files where player votes are stored
    and you can just -1 it everytime they claim one reward, if they have 0, dont let them claim
     
  5. LordJoshie

    LordJoshie Silverfish

    Messages:
    22
    GitHub:
    lordjoshie
    so, I use GrabBag, SimpleWarp, EssentialsPe & Slapper.... I modified Essentials to change its /warp command to /worp, so there isn't incompatibility issues between Essentials and SimpleWarp.

    Then I changed GrabBags /home plugin to be /votehome /setvotehome & so on... I then went and banned that command in all the worlds I have, I have my vote plugin to sent players to the warp I've made with SimpleWarps, having to change Essentials to worp so the command works..

    then also having vote set a votehome for the players, since the command will be sent by vote using rca, it will work. even though the player can set it themselves if they type the command.

    Then after hitting the slapper to get their prize, it runs the command to send them back to their vote home.

    I think the only way this would be exploitable, is if you were in the vote area already when you type vote to set your votehome... so... since that will never happen for a player, I'm not worried.

    Even if they logout, and log back in, then slap the slapper, it should send them to where they were before when they ran /vote to get teleported to the vote area.

    I think, maybe the only way to exploit it, is if you have an alt character, and vote, it will set your home, then you just wait another day to vote again without hitting the slapper between times, and then run /vote again, and it'll set your home to be in the vote area... but you can't leave, and come back, you could just select all the kits for that day. then do the same thing another time.

    so... I'm still kinda stumped... I'm just gonna go with this, because most mcpe players would be too dumb to realize there is a way to exploit the system...

    Only way to make it non-exploitable with what I have available to me, is if I sent the players to hub from hitting the slapper, rather than to a home thats automatically set for them.

    Or, if I find a plugin for perworld join commands, and then when they join a specific world, it will run a command, I can setup to send them to hub when they rejoin in the vote area world.



    Anyone know of a plugin I can use to run a command when a player joins a specific world ?
     
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  7. LordJoshie

    LordJoshie Silverfish

    Messages:
    22
    GitHub:
    lordjoshie
    I'm not trying to make a plugin... but maybe have one made, or shared with me ?

    Anyone have a plugin that runs commands on join, based on permissions ?

    like... if you have the perm, you auto run a command on startup, whether or not you're logged in ?
     
  8. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    If the way players select their reward is by hitting a sign or a NPC, than you can modify it to run the command /hub after running the command to give the player the reward (by using a plugin such as MSpawns to set the hub).
     
  9. LordJoshie

    LordJoshie Silverfish

    Messages:
    22
    GitHub:
    lordjoshie
    but the idea is to send them back to where they came from, and not interrupting their position in game.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.