1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Could you help me with rousources?

Discussion in 'Development' started by nikoskon, Aug 28, 2018.

  1. nikoskon

    nikoskon Silverfish

    Messages:
    20
    Hello,
    im new to plugin development, and i have learned and understand how to create/edit/save resource files, but i havent figured out 1 thing yet... how can i add objects to a list (yaml)?
    fir example we have a list of players and their favourit items:

    bob: 12
    steve: 92
    alex: 18

    i can edit these, but how can i add someone or remove frome the list?
    E.g.:

    bob: 12
    alex: 18
    nikoskon: 1

    I will appriciate any help!
    Thank you,
    nikoskon
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
     
  3. nikoskon

    nikoskon Silverfish

    Messages:
    20
    this video is very useful and helpful, but i would like to know how to do this stuff within a plugin, actual php code!
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    I don't recommend using stuff in the Config class. Just Config->getAll() and manipulate the array directly.
    https://php.net/arrays
    Then Config->setAll() and Config->save() to save the data.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.