Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to only allow one player of one username on? (read)

Comments in 'Plugin Development' started by XFuryMCPE, Jun 12, 2016.

Thread Status:
Not open for further replies.
  1. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    People can login as other people with their username while they're logged in. The old player gets kicked and the new one is on now. How do I stop this?
  2. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Look at this snippet I made to show how you can do it:
    .
    Does it matter if it's not that big of a problem?
    applqpak and CraftYourBukkit like this.
  3. BeynerGames127
    Offline

    BeynerGames127 New Member

    Joined:
    Feb 24, 2016
    Posts:
    22
    Minecraft User:
    Beyner127
    Use SimpleAuth Plugin

    And Check This On The Config:

    #If enabled, existing logged-in accounts won't be kicked if a new player joins with the same name
    forceSingleSession: true
  4. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    He does not want to use a plugin, he's asking for how to do this in code. Please read his question and pay attention to the section the thread is in next time. :) @XFuryMCPE, the snippet I posted above is already a working plugin on its own, feel free to use it in your development.
    The user who created this thread was not asking for a plugin, they were asking for code. Please read the first post thoroughly, thanks.
  5. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    applqpak likes this.
  6. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    Thanks a lot man, I was using $player->kick() and it made a "ghost player" that didn't show up anywhere but counted as a player so the player couldnt log back in.. :p
    applqpak likes this.
  7. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Yes, this will happen if you don't cancel the event as well! :p ;)
  8. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    I see no mention of code by the OP... he is asking "how to stop the problem", and @BeynerGames127 gave a perfectly valid answer.
  9. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    It's in the plugin development section.
    applqpak likes this.
  10. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    True, but judging from the question the OP doesn't seem to realise a plugin isn't needed, and doesn't provide any code to get help with.

    There's no point in helping people reinvent the wheel, unless it's to learn how to make wheels, of which there's no indication here.
    Vaivez66, luke7153 and applqpak like this.
  11. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    I like how "top" servers are asking silly questions :)
    applqpak, SOFe and Vaivez66 like this.
  12. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    "Top" servers ain't developers...
    applqpak and SOFe like this.
  13. CallumDouglas
    Offline

    CallumDouglas New Member

    Joined:
    Jan 20, 2016
    Posts:
    32
    Minecraft User:
    Callum9966
    Most are, the guy who is asking about this problem owns AvengeTech, they have so many custom plugins.
    applqpak likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement