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

I want lern how make plugins.

Comments in 'Plugin Development' started by michal16, Nov 25, 2013.

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

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    But i ask how woudl you hide chat without changing src??? o_O
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    And I told you, loop through the array of players and send the message to ones that aren't in the mute list, then return false to block the broadcast
  3. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    Im a noob at this xD o_O
  4. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    Give me other challenge. You tell everything how do it
  5. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    When you /mute it hide your chat only for you and when /unmute it make the chat visible for you only for you again!
    Taking the challenge? DONT ASK FOR HELP! xD lol
    Falk likes this.
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Allow only OPs to place blocks.
    JassperBeastHD likes this.
  7. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    Everywhere?
  8. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    JassperBeastHD if you don't want help me no comment please ;) he learn me ;)
  9. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Yeah
  10. TrilogiForce
    Offline

    TrilogiForce Ban Evader Banned

    Joined:
    Sep 7, 2013
    Posts:
    228
    Minecraft User:
    TrilogiForce
    never use
    PHP:
    $issuer->sendChat("Example");
    it crash the server and plugin
  11. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    What? Why?
  12. TrilogiForce
    Offline

    TrilogiForce Ban Evader Banned

    Joined:
    Sep 7, 2013
    Posts:
    228
    Minecraft User:
    TrilogiForce
    it crash one time i put that in a huge plugin that i am not developing anymore (it was one with 1000 lines of code!)
  13. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    It likely was another factor that caused the issue
  14. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    I try. If wrong not fix it ;) Just tell me
    PHP:
    <?php

    /*
    __PocketMine Plugin__
    name=ProtectPlugin
    version=0.0.1
    author=michal16
    class=protect
    apiversion=10
    */

    class ExamplePlugin implements Plugin{
        private 
    $api;
        public function 
    __construct(ServerAPI $api$server false){
        }
        public function 
    init(){
        
    $this->api->addHandler('player.block.break',  array());
        
    $this->api->addHandler('player.block.place',  array());
        }
        public function 
    player.block.break{
            if(!(
    $issuer instanceof Player)){
                break;
            }
        }
        public function 
    player.block.place{
            if(!(
    $issuer instanceof Player)){
                break;
            }
        }
        public function 
    __destruct(){
        }
        }
    }
    This is it? Do not fix it. Just tell me it's wrong or it's good
  15. TrilogiForce
    Offline

    TrilogiForce Ban Evader Banned

    Joined:
    Sep 7, 2013
    Posts:
    228
    Minecraft User:
    TrilogiForce
    auhfaywu ?
    PHP:
     public function player.block.break{
     if(!(
    $issuer instanceof Player)){
     break;
     }
     }
     public function 
    player.block.place{
     if(!(
    $issuer instanceof Player)){
     break;
     }
     }
  16. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    what?!
    WHAT?!
  17. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    It's not $issuer it's $data['player'] and it's return false; and not break;
    Magnus-Noel likes this.
  18. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    i have to add something in init?
    i must shearch for somethink like prevent default?
  19. michal16
    Offline

    michal16 New Member

    Joined:
    Aug 27, 2013
    Posts:
    26
    Minecraft User:
    mister_magister
    return not break right?
  20. Magnus-Noel
    Offline

    Magnus-Noel New Member

    Joined:
    Nov 28, 2013
    Posts:
    7
    It's $data['player'] as Falk said
Thread Status:
Not open for further replies.

Share This Page

Advertisement