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

Permission Trigger

Discussion in 'Help' started by Alex, Nov 29, 2017.

  1. Alex

    Alex Spider Jockey

    Messages:
    28
    GitHub:
    Bichwha
    Hi, So i'm trying to know how to make TextFormat:: color to change with a certain permission? For example, If you have the permission fly.command and in UI its green but if you don't have the permission on it and the UI form says Its red
     
  2. KittyDev

    KittyDev Slime

    Messages:
    96
    GitHub:
    FreakingDev
    You should learn the basic "if else statement" in programming
    PHP:
      if($sender->hasPermission("permission fly.command")){
          
    $sender->sendMessage(TextFormat::GREEN "blabla");
      } else {
         
    $sender->sendMessage(TextFormat::RED "blabla");
      }
     
  3. KittyDev

    KittyDev Slime

    Messages:
    96
    GitHub:
    FreakingDev
    And you're not on the right thread
     
  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.