聊天命令
- /ff- 根据当前状态打开或关闭友军射击
- /ff on- 打开友军射击
- /ff off- 关闭友军射击
- /ff help- 打印出基本帮助
配置
设置和选项可以在目录下的文件中进行配置。建议使用编辑器和验证器,以避免格式问题和语法错误。FriendlyFireconfig默认配置
{"Command": "ff",
"Player Default Settings": {
"Friendly Fire": false
},
"Change friendly fire state permission": "friendlyfire.changestate",
"Send friendly fire messages": true,
"Include check if friend": true,
"Include check if team member": true,
"Include check if clan member": true
}
- 更改播放器默认设置将更改每个播放器的默认设置。
- 发送 Friendly Fire 消息与以下消息相关:
- 不友好火
- 其他不友好消防
- 好友攻击
- 包含检查使您能够在攻击时启用/禁用某些检查
地方化
默认消息位于目录下的文件中。要添加对其他语言的支持,请创建一个新的语言文件夹(例如 对于德语),请将默认语言文件复制到新文件夹,然后自定义消息。FriendlyFirelang/ende{
"NoFriendlyFire": "You cannot damage your friends! (<color=#7FFF00>/ff on</color>)",
"OtherNoFriendlyFire": "{0} has friendly fire disabled!",
"FriendAttack": "Your friend {0} tried to attack you!",
"FFOn": "Friendly Fire turned <color=#7FFF00>on</color>!",
"FFOff": "Friendly Fire turned <color=#FF0000>off</color>!",
"AlreadyStateOn": "Friendly Fire is already turned <color=#7FFF00>on</color>!",
"AlreadyStateOff": "Friendly Fire is already turned <color=#FF0000>off</color>!",
"FFHelp": "Friendly Fire:\n/ff on - to turn on friendly fire\n/ff off - to turn off friendly fire",
"CommandArguments": "You have to use <color=#7FFF00>on</color> or <color=#FF0000>off</color> as arguments!",
"NoPermission": "You don't have access to use this command"
}
对于开发人员
要从此 API 调用函数,您首先需要获取插件引用:[PluginReference]
private Plugin FriendlyFire;
要监听朋友何时受到攻击,请使用这个钩子:
Copy
private void OnFriendAttacked(IPlayer attacker, IPlayer victim, HitInfo info)