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

Ui's

Discussion in 'Development' started by abimalek, Nov 6, 2017.

  1. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I'm working on factions'ui and I need to know how to get the data imputed into a Slider or Input bar in it so if they do /f create it opens a tab with a bar where you can type in I what to know how to get the data inputed into the bar
     
  2. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    Pls help
     
  3. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Install API and read tutorials.
     
  4. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
  5. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Use var_dump($data); to see what you need to do, after that look on your console.
     
    NickTehUnicorn likes this.
  6. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I don't get it
    I just need how to get the data inputed as a variable
     
  7. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    I do that on my code, but i don't use API's i use packets and a simple code for this, look my example i have created for you:
    PHP:
    if($pk->formId === ID){
                
    $data json_decode($pk->formData);
                if(
    $data===null){
                }elseif(
    $data !== null){
                    
    $this->plugin->getServer()->dispatchCommand($playertrim(implode(" ", ["f create ".$data[0].""])));
                }
            }
    You just need to put $data[0] on it to get what the player puts on placeholder and do that code into a not null data.
    Sorry if my english are not the best.
     
    Last edited: Nov 6, 2017
  8. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    ik but I use forms so $pk doesn't exist for me
     
  9. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    freaking
     
  10. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    I know you use tha same formapi so can you explain how?
     
  11. abimalek

    abimalek Witch

    Messages:
    74
    GitHub:
    megagastpvp
    //how it works
    //it adds a new inputlike
    form->addInput("factionname");
    //I wana see what is inputed my doesn't use packets
     
  12. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Would you be so kind and stop annoying/offending new developers if you can't contribute to the thread?
    Nobody's stealing your idea, it's not like it's the most unique idea ever...
     
    Last edited: Nov 6, 2017
    Daniel23, Kyd, Jack Noordhuis and 5 others like this.
  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.