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

Time Start

Comments in 'Plugin Development' started by DevWars, Dec 11, 2015.

  1. DevWars
    Offline

    DevWars Banned

    Joined:
    Nov 7, 2015
    Posts:
    28
    Minecraft User:
    PmServer
    Hello Gusy Plz Give me code timer start !
    Example:
    Send popup Player
    Start Game With 10sec
    Start Game With 9sec
    Start Game With 8sec
    Start Game With 7sec
    ...
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Create a repeating task, save a global variable and -- it every second. You should know how to send the popup. If you don't know how to do this, use the search bar.
    PocketKiller and Hotshot_9930 like this.
  3. DevWars
    Offline

    DevWars Banned

    Joined:
    Nov 7, 2015
    Posts:
    28
    Minecraft User:
    PmServer
    Give Me Code Only Plz
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I said use the search bar.
  5. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Please at least try to do things on your own. He told you how to do it now the coding part is up to you. If he just gave you the code you would most likely just copy and paste it without trying to understand it.
  6. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Giving you the code is useless if you don't understand. You'll only blindly copy the code. And threads asking similar questions have been created. Use the search bar before creating a thread.
    PEMapModder and CraftYourBukkit like this.
  7. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    It is the best way to understand things...
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Global variable? Why?
  9. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Depends on if you want to be able to get it in the Main File also, I personally don't use a global one, but well, it's his decision
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Global variables usually end up in conflicts if multiple plugins do that.
    Vaivez66 likes this.
  11. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    PHP Noobs? Who? You?
  12. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    I'm not joking, you know? I'm serious...
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    In PocketMine plugins, we rarely use global variables. Instead, use a class property. Global variables are not that good because:
    1. Likely collision between plugins. At least in other things we have namespaces. It is very inconvenient if you use global variables and prefix the global variable references with your plugin name every time.
    2. They are not reset after a /reload. If course you can unset them on disable, but again, why?
    3. Instead, we have class properties. They solve both of the problems above.
    4. If you are saving objects in global variables, it is similar to using static variables. In PHP (at least in present PHP versions, not sure in the future) binaries used by PocketMine default distributions, saving objects in a global/static context (instead of in a class reference's context) may result in strange bugs.
    I didn't suggest to use local variables
    AndrewBit and CraftYourBukkit like this.

Share This Page

Advertisement