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

Help at HealthManager plugin

Comments in 'Plugin Development' started by Primus, Jun 26, 2015.

  1. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Hello :), as i upgraded my Windows XP to Linux i started to create a plugin that always was essential for me.
    It gives a feature to see players health, set health or max health, and more i have a many good ideas for my plugin.

    Now i encountered a problem so this is my theory:

      1. Create a file and add health information to file for each player (hp, maxhp)
      2. Update the file on Leave, Join, Respawn
      3. When player Joins give back the health stats from the file
    And these are my problems:
    1. Is it good to make file.yml for each player?
    2. How can i set a directory for those files cuz they all are created on my PluginFolder right now
    3. How do i read it? i use:
    PHP:
    file_put_contents($file, array(
    "$name=> array(
    "hp" => "$hp"
    "maxhp" 
    => "$maxhp"
    )
    ))
    4. Is it possible to add extra hearts to clients screen?
    5. How can i update the information if i use only one file for all players?

    P.S. Sorry for my deamn "good" english. I'm from Latvia, I supose one and the only :(
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    If you want to store an array in a file, consider using the Config class or using the function yaml_emit_file
    iksaku likes this.
  3. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    How about other things?

Share This Page

Advertisement