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

Need help with adding variables

Comments in 'Plugin Development' started by merge, Jun 11, 2014.

  1. merge
    Offline

    merge New Member

    Joined:
    Jun 11, 2014
    Posts:
    5
    Minecraft User:
    lukealec0518
    I need to add two variables together
    here is the current code

    private $gamestarttime = 5;
    private $gamewaittime = 5;
    private $minute = $this->gamewaittime + $this->gamestarttime;
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The third time.
    You can't resolve variables when declaring fields.
    Lambo likes this.
  3. merge
    Offline

    merge New Member

    Joined:
    Jun 11, 2014
    Posts:
    5
    Minecraft User:
    lukealec0518
    what does this mean??????????
  4. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    435
    Plugins:
    4
    Minecraft User:
    Lambo
    Maybe use:
    PHP:
    public function onEnable(){
       
    $this->minute $this->gamewaittime $this->gamestarttime;
    }
    Darunia18 and PEMapModder like this.

Share This Page

Advertisement