Save how often a player has placed a block

Discussion in 'Plugin Development' started by RE3ELL, May 10, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    i´m developing a plugin for my server, which as soon as it´s finished will prevent players from placing blocks of a specific id, when they have reached the block limit of this block id which is set in a config.yml by the server admins.
    I managed to save how often a player has placed ONE block id by using SQLibrary with SQLite like that:
    sql.query("CREATE TABLE IF NOT EXISTS `restrict` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, 'player' varchar(16), 'amount' INTEGER)");
    But this only works with one block id and metadata. Now i would like to give the ability to write a list of blocks you want to set a limit for in my config.yml like this:
          # Usage: Placeable Amount : ID : Metadata : Description
          # Expamle: Players can only have 2 Personal Anchors (Railcraft Mod)
          - 2:1053:2:Personal Anchor
          - ...
    My problem is:
    How do i create a sqlite table which stores every player and how often they have placed BlockA, BlockB,...

    I´d like to mention that I am really new to Java and SQL, but have 3 years of development experience in Pascal (from school and free time).
    If SQLite is not a good way to deal with this, maybe you could give me a link to a tutorial on how to do it differntly or be that kind to give me at least an example.

    Thank you for your time,
  2. I have these here:

    Can't help a lot now, not at home, but im sure it could help. Used it for nosecandy before.
  3. Offline


    Thanks, i´ll look into it tomorrow.
Thread Status:
Not open for further replies.

Share This Page