Player to all ops message?

Discussion in 'Plugin Development' started by megasaad44, Jul 16, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    SnipsRevival

    You want args.length > 1 because only 1 arg would be /reporter bug. Therefore anything more than that would be caught by args.length > 1.

    Now if your player variable is already set to be your sender, use another name inside the for loop.

    The for loop is going through each player that is online, and you want to send a message to those players if they are ops. That is what that code will do.
     
  2. Offline

    megasaad44

    SnipsRevival OOOOH... Ok then, How about the int? I think its useless in that case
    And the builder part is weird xD
     
  3. Offline

    SnipsRevival

    The int? I have no idea what you are talking about.
     
  4. Offline

    megasaad44

     
  5. Offline

    SnipsRevival

    That is necessary because you want to start building you message string with args[1] not args[0] or any other arg. Once the loop has added args[1] to the string, it will move on to args[2] and so on until there are no more args.
     
  6. Offline

    megasaad44

    Ahh. I see. Thanks

    But why does it say strbuilder is wrong? it has a red line under it

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  7. Offline

    SnipsRevival

    Because it is StringBuilder not String.Builder.
     
  8. Offline

    megasaad44

    SnipsRevival But if it says it has an error, then the code wont work. Or will it? :confused:
     
  9. Offline

    SnipsRevival

    Huh? Fix what I said and tell me whether or not there is still an error.
     
  10. Offline

    megasaad44

    Last edited by a moderator: Jun 3, 2016
  11. Offline

    SnipsRevival

    What you are doing makes no sense. If you do it exactly the way I showed you earlier, you shouldn't get errors.
     
  12. Offline

    megasaad44

    Hmm. Weird. I'll do some research.
     
  13. Offline

    SnipsRevival

    You realize you weren't doing what I showed you, right?
     
  14. Offline

    megasaad44

    But i found what i wanted:

    don't you just love youtube? :p
     
Thread Status:
Not open for further replies.

Share This Page