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

how can do this?(please read the post.)

Comments in 'Plugin Development' started by CoolGuyPL, Nov 5, 2014.

  1. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    how can i do like
    Code:
    if(cmd.getname().equalsIgnoreCase("some command name") && sender instanceof Player)
    in pocketmine?
    i just need the && thing. like
    PHP:
    if($thing "give me!")&&(!($player->hasPlayedBefore(){
    }
    please help!
  2. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    btw the first one is a java code for bukkit.
  3. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    sorry forgot to put a parentheses after hasPlayedBefore(). ;)
  4. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    sorry forgot to put a parentheses after hasPlayedBefore(). ;)
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Turn both strings to lowercase using strtolower() and compare if the values are equal using ===.
    Both && and and are supported in PHP.

    And if you aren't sure, please read the PHP docs.
    CoolGuyPL likes this.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This is not necessary.
  7. ProjectInfinity
    Offline

    ProjectInfinity Active Member Plugin Developer

    Joined:
    Sep 7, 2014
    Posts:
    112
    Plugins:
    3
    Minecraft User:
    ProjectInfinity
    Looking at the example you have given I think you need to go over PHP syntax before attempting to create a plugin.

Share This Page

Advertisement