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

Solved Chatcount

Discussion in 'Development' started by BlawoHD, Aug 4, 2018.

  1. BlawoHD

    BlawoHD Silverfish

    Messages:
    21
    How do I count the chat messages from all players? Can anyone give me an example?

    PHP:
            public function onChat(PlayerChatEvent $event) {

                
    $player $event->getPlayer();

             

                if(
    $event->getMessage()){

                    
    $config = new Config($this->folder "config.yml"Config::YAML);

                    
    $chat $config->get("Chatnachrichten");

                    
    $gchat = (Int) $chat 1;

                 

                    
    $config->get("Chatnachrichten"$gchat);

                    
    $config->save();

                }

            }
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Just replace get with set on that line and you're set (pun intended).

    Und: Bitte. Versuch. Nachzudenken. Und verwende Englisch in deiner Datenbank.
    ENG, so mods don't complain: Please. Try to. Think. And use English in your database.
     
    OnTheVerge likes 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.