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

[New-Api] help with the config

Comments in 'Plugin Development' started by swagboy47, Jul 12, 2014.

  1. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    so i want get the part that is after the key , for example:
    $this->config->set($args[0], array($args[1], $args[2], $args[3], $args[4]));
    and i want get from that line only $args[2] , how do i do that ?
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Get $args[0] and then get the second element?
  3. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    yes
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    So what's the issue? Do you not have $args[0]?
  5. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i want to get only $args[2] not with the other $args from $args[0]
  6. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    What do you want?
  7. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    oh god , for example you do an command and it well add the $args to the config.yml and you want get only on of the things in the line not all of them
  8. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    PHP:
    $argss "" ;
    foreach(
    $args as $arg){
       
    $argss .= $arg." ";
    }
    $this->config->set(""$argss);
  9. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Don't set YAML value with "" as key.
    The issue is he doesn't know PHP.

    Answer:
    PHP:
    $config->get($args[0])[1];
  10. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    thank you , and please stop saying "you don't know php " or i well report you
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I am only stating the fact. Go report me. I bet @Falk had already read through all my saying of that, and since he didn't warn me, I believe that stating that fact is sensible because you just don't understand arrays, which is pretty basic for an "Active Member" like you to know.

    What I mean is, an "Active Member" like you who is messing with packets should be able to translate "Get $args[0] and get the second element" directly into PHP code $config->get($args[0])[1].
    Dutok likes this.
  12. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    okay , but i tolled you 1000 times stop saying that and you keep saying it
  13. Dutok
    Offline

    Dutok Notable Member Plugin Developer

    Joined:
    Jun 20, 2014
    Posts:
    371
    Plugins:
    3
    Minecraft User:
    Dutok
    I think it's okay for him to repeat it since this thread wouldn't be here if you knew PHP.
    Darunia18 likes this.
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes, and I held myself 1000 times from telling him that the word is "told" not "tolled" and from telling him to fix his grammar and vocabulary mistakes and typos.
  15. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    a lot of people in the forum ask questions like that and they get straight answer without " go learn php " , is he racist to me o_O because i am syrian ?
    or what ?
  16. Dutok
    Offline

    Dutok Notable Member Plugin Developer

    Joined:
    Jun 20, 2014
    Posts:
    371
    Plugins:
    3
    Minecraft User:
    Dutok
    Lol, no.. He's not being racist. You weren't asking the usual questions like how to set a config.. You were asking how to read an array.
    PEMapModder likes this.
  17. KnownUnown
    Offline

    KnownUnown Active Member Plugin Developer

    Joined:
    Aug 22, 2013
    Posts:
    65
    Plugins:
    1
    Minecraft User:
    KnownUnown
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Darunia18 likes this.

Share This Page

Advertisement