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

    RE3ELL

    Hi,
    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:
    Code:
    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:
    Code:
    Configuration:
      Modules:
        BlockRestriction:
          # Usage: Placeable Amount : ID : Metadata : Description
          # Expamle: Players can only have 2 Personal Anchors (Railcraft Mod)
          Blocklist:
          - 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,
    re3ell
     
  2. I have these here:

    https://www.dropbox.com/sh/zkqg5ekvbb5ro1k/HG0AwwXZxm

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

    RE3ELL

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

Share This Page