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

/command Player

Comments in 'Plugin Development' started by MyAJVideo, Jun 29, 2015.

  1. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    How do i add something like /kill [player] ? This [player] how do I add that ? I want to make a plugin where I can set the players max helth but I don't know how to make they I can type in the player name in chat and it will set his helth. I thinks it has something to do with [args] but I'm not sure
    Thanks
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $player->setHealth
    $player->setMaxHealth
  3. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Thanks but I know that I want to find out wen I'm in game and I do /setmaxhelth MyAJVideo how do I get like the name which I will use in the programing
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $server->getPlayer($name)
  5. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    So how would i add that to a message which just tells him something ?
    So something like /hi MyAJVideo and that will just say hello this is a message ?
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    You should read other threads and learn PHP.
  7. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Everybody says I supose to learn php I have alredy learned it but in German so many things are different in words
  8. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Also, du kannst den Spieler so auf dem Server finden:
    PHP:
    $player $args[1];
    if(
    $player $this->getServer()->getPlayer($player)){
       
    // Spieler auf dem Server
    } else{
       
    // Spieler nicht auf dem Server
    }
    MyAJVideo and iDirtPlayzMC like this.
  9. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Danke
  10. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    to send msg use $sender->sendMessage("???");
  11. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    Yes. sendPopup(); for Popup Message and sendTip(); for a Tip Message.
  12. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    whats different btw Sendtip and sendpopup?
  13. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Popup is above the hotbar, like when switching an item. The Text on there is a popup. A Tip is in the middle of the screen and a big bigger, like when using a boat.
  14. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    That's nothing he wanted:3
  15. iDirtPlayzMC
    Offline

    iDirtPlayzMC Active Member

    Joined:
    Apr 10, 2015
    Posts:
    264
    Minecraft User:
    iZenith_xPr
    ow ok thanks
  16. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    He asked if sendMessage(); is the right way to send a message. I said yes, and I gave him some other informations about messages. :)
    Please read before posting. Thanks!
  17. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Well, you both told him how to send a message to $sender, not $player.
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is no difference... It's just a name that you can call it with whatever you like...
  19. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Well, in that case he asked to send a Message to a Player($args[1]) which he has to define/check as a Player first(my post), then he can do $player->sendMessage(). In the posts of @iDirtPlayzMC and @GmWM they didn't define $player, so it wouldn't work to change $sender to $player -> That's not what @MyAJVideo wanted
  20. MyAJVideo
    Offline

    MyAJVideo Active Member

    Joined:
    May 16, 2015
    Posts:
    148
    Minecraft User:
    mrAJV2010
    Ahhm what?

Share This Page

Advertisement