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

FakeMessagePro

Comments in 'Plugin Development' started by JassperBeastHD, Oct 10, 2013.

  1. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    Last edited: Oct 11, 2013
  2. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    You need
    PHP:
    class=fakemessage
    in the comment marks
    wies and iksaku like this.
  3. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Before switch($cmd) put $username = $issuer->username;
    wies likes this.
  4. JassperBeastHD
    Offline

    JassperBeastHD Banned

    Joined:
    Aug 27, 2013
    Posts:
    436
    Minecraft User:
    JassperBeastHD
    Thx what else how do u make it is it $username when u do the command /fmj it say ur name join the game sooo is it $username? @Glitchmaster_PE glit @ZacHack
  5. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Fixed version (typo in api btw)
    PHP:
    <?php
    /*
    __PocketMine Plugin__
    name=FakeMessage
    description=FakeMessage
    version=1.0
    author=JassperBeastHD
    class=fakemessage
    apiversion=10
    */
    class fakemessage implements Plugin
    {
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false)
    {
    $this -> api $api;
    }
    public function 
    init()
    {
    $this -> api -> console -> register("fmj""FakeJoinMessage.", array(
    $this,
    "handleCommand"
    ));
    $this -> api -> console -> register("fml""FakeLeaveMessage.", array(
    $this,
    "handleCommand"
    ));
    }
    public function 
    __destruct()
    {
    }
    public function 
    handleCommand($cmd$args$issuer$alias)
    {
    switch(
    $cmd)
    {
    case
    "fmj" :
    $username $issuer->username;
    $this -> api -> chat -> broadcast("<server> " $username " has joined the game");
    break;
    case
    "fml" :
    $username $issuer->username;
    $this -> api -> chat -> broadcast("<server> " $username " has left the game");
    break;
    }
    }
    }
  6. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Use ("".$username." Joined the game");
  7. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    the <server> makes it more real
  8. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Oh yah i forgot lol ("<server> ".$username." Joined the game"); I like it with no spaces it's less confusing and looks nicer
  9. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    It's
    PHP:
    ("<server> " $username " has joined the game")
    has
  10. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Oh lol but it still looks nicer without spaces :p
  11. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    I like it with spaces, you can see it better and it is not all jumbled up, but we all have our preferences :D
  12. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    Yah every dev does lol

Share This Page

Advertisement