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

How to connect another config?

Discussion in 'Help' started by ComradeStalin, Feb 19, 2022.

  1. ComradeStalin

    ComradeStalin Spider

    Messages:
    11
    Hi! I create plugin of passport for rp server, but i dont know how i can connect and give data in another plugin?

    Khm... Sorry of my English
     
  2. ComradeStalin

    ComradeStalin Spider

    Messages:
    11
    I took the PurePerms plugin as an example, in the plugin from which I need to pull the data, I wrote this
    PHP:
    public function getGroup($p){
        
    $name $p->getName();
          
    $och $this->ocho->getAll();
          
    $dir $this->getServer()->getDataPath();
          
    $content file_get_contents($dir."plugins/RichardRadioStation/point_radio.json");
          
    $data json_decode($contenttrue);
        if(isset(
    $ocho[$name])){
          
    $this->ocho->get($name$data["$name"]);
        }
      }
    after that, in the plugin that should accept this data, I made the following
    PHP:
    if($this->Eco->myMoney($p) >= 1000){
                      if(
    $this->GI->getGroup($p) >= 5){
                            
    $this->Eco->reduceMoney($p1000);
                            
    $this->rich->set($p->getName(), 1);
                            
    $this->rich->save();
                            
    $p->sendMessage("§l§b» §fGreat job, your work is Police!");
                        } else {
                            
    $p->sendMessage("§l§b» §сYou havent need exp!");
                        }
                            } else {
                                  
    $p->sendMessage("§l§b» §сyou havent money!");
                            }
    But it not work, why?
     
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    PHP:
    $this->GI->getGroup($p// this call doesn't return a value, you can't do comparison with void value
     
  4. ComradeStalin

    ComradeStalin Spider

    Messages:
    11
    thanks!\
     
  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.