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

kick

Comments in 'Plugin Development' started by Driesboy1, Dec 14, 2015.

  1. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
    a code to kick a player please
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    Player::kick($reason "");
    don't use
    PHP:
    Player::close()
    It's for internal use. (mostly)
  3. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
  4. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
    how to use
  5. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
    PHP:
    $this->Player::kick($reason "");
    or what
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    $player->kick("Your reason here");
    Driesboy1 likes this.
  7. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
  8. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    so Player::close() will close the conn? with no reason?
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Yes if you put $notify = false.
    PHP:
    /**
    * Note for plugin developers: use kick() with the isAdmin
    * flag set to kick without the "Kicked by admin" part instead of this method.
    *
    * @param string $message Message to be broadcasted
    * @param string $reason Reason showed in console
    * @param bool $notify
    */

  10. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Kick the player? Through Console? Through Console would be somethin' like:

    PHP:
    $this->getServer()->dispatchCommand(new ConsoleCommandSender"kick PlayerNameHereYouCanUseAVariable Kicked You Through Console");
  11. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    [CONSOLE] Kicked Steve 'Kicked You Through Console';
    Not good idea.
  12. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    What's wrong with it? I'm just saying if he wants it through console...
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It is bad practice and highly inadvisable to do something via a command indirectly rather than doing it by a direct API function.
  14. applqpak
    Offline

    applqpak Active Member Plugin Developer

    Joined:
    Dec 16, 2015
    Posts:
    284
    Plugins:
    1
    Minecraft User:
    applqpak
    Oh yeah, thanks for clarifying that. :)

Share This Page

Advertisement