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

file_put_contents

Comments in 'Plugin Development' started by Guillaume351, Mar 25, 2014.

  1. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    file_put_contents($this->api->plugin->configPath($this . "mode.txt"), array("Test1"=>"22"));
    "Object of class TimeSet could not be converted to string " when executing this line. (my plugin is of class TimeSet)
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    You can't write an array to a file you need to have a string. You may want to look into the yaml functions, they will easily read and write array data to files.
  3. Guillaume351
    Offline

    Guillaume351 Active Member Plugin Developer

    Joined:
    Oct 11, 2013
    Posts:
    150
    Plugins:
    1
    Minecraft User:
    Guillaume351
    Thank you. What I want to do is for each world, it write a number. I want to be able to read a replace this number. Do you have an idea how to ? Thank you.

Share This Page

Advertisement