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

Global Variable

Comments in 'Plugin Development' started by CrazedMiner, Jun 6, 2015.

  1. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    In my Main.php I want to have $seconds = 0; and then from my seconds.php file be able to get this variable and add 1 to $seconds ($seconds++;), I cant figure out how to do this so any and all help is appreciated! :)
  2. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Now I'm getting this error on the console :/
    Code:
    22:36:57 [NOTICE] ClassCastException: "Object of class CrazedMiner\Main could not be converted to int" (E_NOTICE) in "/src/pocketmine/scheduler/ServerScheduler" at line 120
    
    
  3. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    That¿s because you're doing something wrong in your code xD
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why not just use time()?
    CrazedMiner likes this.

Share This Page

Advertisement