javascript - C# 意外符号 }

标签 javascript c# unity-game-engine console

我是 CSHARP 的新手,但我对 javascript 非常流利。

我正在为 Rust(一款多人游戏)编写一个插件,该插件将通过一个名为 Oxide 的 modloader 进行处理。 Oxide API

我得到的错误:

[Oxide] 6:30 AM [Error] Sulfur plugin failed to compile!
[Oxide] 6:30 AM [Error] Sulfur.cs(19,0): error CS1525: Unexpected symbol `}'

我直接从 Oxide 的 API 页面复制了我的代码,并编译了它。但是我收到一个非常奇怪的错误,我尝试添加和取出内容,该错误似乎是在这一行调用的

namespace Oxide.Plugins
{
    [Info("Sulfur", "Christopher Allen", 0.1)]
    public class Sulfur : RustPlugin
    {
        void OnServerInitialized()
        {
            Puts("Sulfur has been initialized.");
        }

        void OnPlayerInit(BasePlayer player)
        {
            var message = string.Format("{0} has joined the server", player.displayName);
            rust.BroadcastChat({ message });
        }
    }
}

如果有人能够解释为什么会发生这种情况,我们将不胜感激。

最佳答案

rust.BroadcastChat(message);

去掉大括号即可,如果您有任何其他问题,请在steam上问我:http://steamcommunity.com/id/Bycrome/

关于javascript - C# 意外符号 },我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34250636/

相关文章:

c# - 为什么即使未选中禁用编辑器中的脚本,它仍然可以工作并使对象可交互?

unity-game-engine - Unity 游戏中缺少 dSym

c# - Visual Studio 2015 社区报告查看器版本 12 使用 C# 获取额外 margin 时出错

unity-game-engine - 贴花环绕网格

javascript - 仅当禁用按钮时,如何才能在 Angular 模板 (.html) 中显示工具提示?

javascript - 单击动态创建的 DOM

c# - .Net Core RC2 MVC 参数在 Controller 中为空

c# - Azure Function 停止工作 - 无法加载类型 'Microsoft.Azure.WebJobs.BlobTriggerAttribute'

javascript - 使mongoDB用字符串替换单值数组

javascript - 谷歌登录不提供回调