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

Amount of Money

Comments in 'Plugin Development' started by Skullex, Mar 29, 2016.

  1. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    How exactly would you run events on a player with a certian amount of money??

    Like if a player has 5000 they get a particle trail onMove. :)
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And how do we know which plugin is the money provided from?

    Suppose the function is getAmount(), why can't you simply use if(getAmount() >= 5000) ?
    Skullex likes this.
  3. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Sorry for not providing that information

    PHP:
    $pm $server->getPluginManager();
    if(!(
    $money $pm->getPlugin("PocketMoney"))
    && !(
    $money $pm->getPlugin("GoldStd"))
    && !(
    $money $pm->getPlugin("EconomyAPI"))
    && !(
    $money $pm->getPlugin("MassiveEconomy"))){
    return 
    null;
    }
    return 
    $money;
    PEMapModder likes this.
  4. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    Thankyou
  5. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    How should $money be all of them? Use or(||) instead of and(&&)
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    a() and b()
    If a() resolves to false, b() wouldn't be executed at all.
    PHP:
    !a() and !b()
    If a() resolves to true, b() wouldn't be executed at all.
    There is no difference between using || and && in this situation. Just that he likes handling exceptional cases first.
    Skullex likes this.

Share This Page

Advertisement