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

How to do?

Comments in 'Plugin Development' started by Marcelo234, Mar 23, 2016.

  1. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    Hey Guys..
    So there is a file named:"coins"
    So Guys.a event happen and the Plugin should write this in the Coins file:
    Code:
    [Playername,Coins],[Playername,Coins],.....
    
    So the Playername should be a Name and the Coins a Number...
    But how to write?
    With set()?
  2. korado531m7
    Offline

    korado531m7 Active Member

    Joined:
    Apr 4, 2015
    Posts:
    158
    Minecraft User:
    korado531m7
    You want to add coin amount?
  3. korado531m7
    Offline

    korado531m7 Active Member

    Joined:
    Apr 4, 2015
    Posts:
    158
    Minecraft User:
    korado531m7
    This code write like
    Code:
    playername:
    coin: 0
    
    PHP:
    //Define $this->config as configuration,

    //If player joined server, add 1 coin

    function addOnJoin(PlayerJoinEvent $ev){
       
    $player $ev->getPlayer();
       
    $name $player->getName();
       
    $this->config->set($name,array($this->config->get($name)["coin"]+1));
    }
    I didn't test, maybe, work...
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    This will delete other non-coin properties in the array.

    What about using getNested?
    applqpak likes this.
  5. Marcelo234
    Offline

    Marcelo234 New Member

    Joined:
    Oct 18, 2014
    Posts:
    204
    So how to write? Like the Plugin VIPSlots
    ....the Plugin will create a vip list...I will create a coins list

Share This Page

Advertisement