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

How to add time for use to command

Comments in 'Plugin Development' started by IcePL, Mar 22, 2016.

  1. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    Hi how to do that command was in time?
    For example, that a player can use it only once a day . I write a plugin for quests . I have already written three quests :)
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Save the time() or the date() and check if either the saved time + 1 day is less than the current time() or whether the saved date() is not equal with the current one. If you use date(), of course, use the same format.
    applqpak likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    About date(), just using date("dmy") is good enough for your purpose.
    applqpak likes this.
  4. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    and you supply me a model date () ?
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That depends on how you save the players' data...
    applqpak likes this.
  6. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    I use it to add time to command e.g server kits i can the command /kit (kit) only one per day?
    Sorry for my englisch i use google translate :)
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Can you post your code here?
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Then you need to have data saving. As for how to do data saving, please search the forums.
  9. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    And do not search with the search bar, it's s*** (sorry @Moderators, but its really useless)
    [Search words are too short, too common, too long, did not find anything, i can't even search in the forums if you are in plugins, on the start site I'm bugging around,...]
    Use "Google Hacking" Enter in google YOUR_SEARCH_WORD (for example config saving) and then site:forumspocketmine.net
    So it would result into "config saving site:forums.pocketmine.net"
    Primus likes this.

Share This Page

Advertisement