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

Please Help really need help on my plugin

Discussion in 'Plugin Help' started by iChaoticSoldier, Feb 26, 2017.

  1. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    PHP:
    ////////////////////////////// CHAT ////////////////////////////////
                        
    if (strtolower($args[0]) == "chat" or strtolower($args[0]) == "c") {
                           
                            
    $sender->sendMessage($this->plugin->formatMessage("§aFaction chat disabled"true));
                            return 
    true;
                           
                            if (
    $this->plugin->isInFaction($player)) {
                                if (isset(
    $this->plugin->factionChatActive[$player])) {
                                    unset(
    $this->plugin->factionChatActive[$player]);
                                    
    $sender->sendMessage($this->plugin->formatMessage("§aFaction chat disabled"true));
                                    return 
    true;
                                } else {
                                    
    $this->plugin->factionChatActive[$player] = 1;
                                    
    $sender->sendMessage($this->plugin->formatMessage("§aFaction chat enabled"true));
                                    return 
    true;
                                }
                            } else {
                                
    $sender->sendMessage($this->plugin->formatMessage("You are not in a faction"));
                                return 
    true;
                            }
                        }
                        if (
    strtolower($args[0]) == "allychat" or strtolower($args[0]) == "ac") {
                           
                            
    $sender->sendMessage($this->plugin->formatMessage("§aFaction chat disabled"true));
                            return 
    true;
                           
                            if (
    $this->plugin->isInFaction($player)) {
                                if (isset(
    $this->plugin->allyChatActive[$player])) {
                                    unset(
    $this->plugin->allyChatActive[$player]);
                                    
    $sender->sendMessage($this->plugin->formatMessage("§aAlly chat disabled"true));
                                    return 
    true;
                                } else {
                                    
    $this->plugin->allyChatActive[$player] = 1;
                                    
    $sender->sendMessage($this->plugin->formatMessage("§aAlly chat enabled"true));
                                    return 
    true;
                                }
                            } else {
                                
    $sender->sendMessage($this->plugin->formatMessage("You are not in a faction"));
                                return 
    true;
                            }
                        }
                    }
                }
            } else {
                
    $this->plugin->getServer()->getLogger()->info($this->plugin->formatMessage("Please run command in game"));
            }
        }

    }
    How do u fix that everytime i use /f chat on my server it keep showing up /f chat is disabled please help i just use awzaw faction plugin to my server
     
    Last edited: Feb 27, 2017
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Please dont put code that you dont understand into plugins
    it's just not a good idea when you dont even know if it even works, or what it does
     
  3. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    The command works though but i cant get the full chat on faction
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    because you only pasted part of it,
    i assume
     
  5. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    Nope i added the chat format on the main then i tested first test it work it shows up in the game [TEST] Player: Hi then when i switched my device to NVIDIA SHIELD tab and transfer my files in it Now doesnt work it only shows the message /f chat is disabled
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Look at what you are doing. Right after your first if statement, you are sending a faction chat disabled message regardless of anything else. Nothing else is executed because the command returns true before anything else can be run. The PHP function return has the same effect as break in this case. This isn't a PocketMine issue. Also, don't take code and paste it. It may help you once or twice, but you will benefit exponentially more when you write and understand it yourself.
     
    EdwardHamHam and jasonwynn10 like this.
  7. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    LOL its from awzaw factions is use his plugin but i cant get the /f chat to work so thats why im asking how do u fix it......
     
  8. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    I just explained one issue that you can easily resolve.
     
    Marabou likes this.
  9. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    The plugins wasn't made by Awzaw, it's a fork. It can't be 100% perfect, changes has to be done by the original author... This doesn't mean we can't fix it, we can by forking it and if it works, you can PR.
     
    Muqsit, iChaoticSoldier and Marabou like this.
  10. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    Nah. I cant understand the faction i can only be understand some small php codes
     
  11. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    This needs to be in the facepalm section
     
  12. ZakousseMC

    ZakousseMC Spider Jockey

    Messages:
    46
    GitHub:
    ZakousseMC
    Watch your language, @jasonwynn10 was right, this thread should have been in facepalm section, and btw, please d'ont put titles to your thread such as
    "Please Help really need help on my plugin"
     
  13. iChaoticSoldier

    iChaoticSoldier Spider Jockey

    Messages:
    37
    GitHub:
    iChaoticSoldier
    Sorry dude, didnt mean it to say it to him.
     
  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.