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:
without:Code:BetterChat.cs(184,44): error CS1525: Unexpected symbol `List', expecting `,' or `]'
Code:BetterChat.cs(176,0): error CS1525: Unexpected symbol `,', expecting `,' or `]'
Help @ debugging a C# plugin
Discussion in 'Rust Development' started by LaserHydra, Jul 19, 2015.
-
tried to solve the compile errors, should compile but no guarantee to work
Attached Files:
-
-
-
Attached Files:
-
-
but, is that needed? For example here:
BasePlayer player = (BasePlayer) arg.connection.player;
that (BasePlayer)
or somewhere else that (bool) -
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
-
[DOUBLEPOST=1437330043,1437320513][/DOUBLEPOST]
@Nogrod -
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.
-
You see the error. I don't know where the error is :c
-
line 107: Check for null on the player object..Line 110 check for a null message object.
-
-
Not my problem, it is your plugin figure it out.
-
[DOUBLEPOST=1437402525,1437331836][/DOUBLEPOST] -
-
[DOUBLEPOST=1437405685][/DOUBLEPOST]Im interested in which he used. Can't find it