1. Hello, i was working on a C# rewrite of my plugin Better Chatname, but I got a syntax error. I checked it with http://tohtml.com/csharp/ and It marks some of the } red...

    Code:
    https://github.com/LaserHydra/Plugins/blob/master/BetterChat.cs

    With the "Useful Methods" part:
    Code:
    BetterChat.cs(184,44): error CS1525: Unexpected symbol `List', expecting `,' or `]'
    without:
    Code:
    BetterChat.cs(176,0): error CS1525: Unexpected symbol `,', expecting `,' or `]'
     
  2. tried to solve the compile errors, should compile but no guarantee to work :D
     

    Attached Files:

  3. What should the failure have been?
     
  4. created a diff image if that help ;)
     

    Attached Files:

  5. Ah yeah that helped, some lil careless mistakes
    but, is that needed? For example here:
    BasePlayer player = (BasePlayer) arg.connection.player;
    that (BasePlayer)
    or somewhere else that (bool)
     
  6. yes the casts are needed since the variables/method returns have different types, arg.connection.player is a MonoBehavior and the Call method returns object
     
  7. but I could also do - as BasePlayer | as bool - right?
    [DOUBLEPOST=1437330043,1437320513][/DOUBLEPOST][​IMG]
    @Nogrod
     
  8. You could use the as keyword in this case, but you should then have a null check afterwards. The null check is because if the as keyword can't convert the object type it will return null.
     
  9. You see the error. I don't know where the error is :c
     
  10. line 107: Check for null on the player object..Line 110 check for a null message object.
     
  11. well yeah, the error doesnt appear anymore. But nothing changes now. means one of those 2 is null, but it should not be.
     
  12. Not my problem, it is your plugin figure it out.
     
  13. trying.
    [DOUBLEPOST=1437402525,1437331836][/DOUBLEPOST]
    How did you create such image? I guess you didn't do that all by hand
     
  14. Used a diff merge tool, there are plenty online: https://www.diffchecker.com/
     
  15. thanks
    [DOUBLEPOST=1437405685][/DOUBLEPOST]Im interested in which he used. Can't find it