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

Add a number in a config file

Comments in 'Plugin Development' started by BlubberBoy333, May 2, 2016.

  1. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
    Hey guys, I was wondering if someone could help me out with a plugin I'm making. So I want to be able to store a number in a config file, then add onto that number. For example:
    When a player votes, it will get the player's file, find the number in the file, and add 1 to the number that is in the file.
    Does anyone know how i can do this? I know how to do math in php, but when I try to use it with a config file it doesn't work.
  2. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    PHP:
    $config->set('number', (intval($config->get('number') + 1));
    $config->save();
    applqpak and BlubberBoy333 like this.
  3. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
    Thanks :)

Share This Page

Advertisement