聊天命令

复制

/copy NAME options values - Copy a building
Example: /copy home radius 3 method building
Short example: /copy home r 3 m building

语法 – 选项

  • 每个 true/false – 默认值:true – 检查每个实体的半径
  • 方法 Building/Proximity – 默认值:Proximity – 选择用于复制建筑物的机制类型 – 建筑物:仅复制当前建筑物。邻近性:复制建筑物附近的所有方块。(在这些情况下,Building 可能缺少某些可部署对象,也使用邻近性)
  • radius XX – 默认值:3 – 设置半径以搜索每个建筑部件和可展开对象周围的实体
  • share true/false – 默认值:true – 设置为复制数据 CodeLocks、BuildingPrivileges、SleepingBag
  • tree true/false – 默认值:false – 设置为复制树和资源

/paste NAME options values - Paste a building
Example: /paste home auth true stability false
Short example: /paste home a true s false

语法 – 选项

  • auth true/false – 默认值:true – 授权所有橱柜中的播放器
  • blockcollision XX – 默认值:0 – 检查 XX 半径内是否有可能与新建筑发生碰撞的东西,如果是,则阻止建筑。0 表示停用检测。
  • deployables true/false – 默认值:true – 设置为粘贴可部署对象
  • **高度 XX **- *默认:0 *- 调整高度粘贴
  • autoheight true/false – 默认值:true – 是否尝试找到建筑物的最佳高度
  • 清单 true/false – 默认值:true – 设置为粘贴清单
  • stability true/false – 默认值: true – 设置 false 以忽略稳定性系统
  • vending true/false – 默认值:true – 设置为粘贴自动售货机的销售、名称和广播
  • entityowner true/false – 默认值:true – 复制建筑物的实体所有权。
  • position x,y,z – 覆盖生成位置
  • rotation x – 默认值:0 – 更改旋转校正

粘贴

/pasteback NAME options values - Paste on old place a building where it was when it was saved
Example: /pasteback home auth true stability false
Short example: /pasteback home a true s false

语法 – 选项

  • auth true/false – 默认值:false – 在所有橱柜中授权播放器
  • deployables true/false – 默认值:true – 设置为粘贴可部署对象
  • **清单 true/false **- 默认值:true – 设置为粘贴清单
  • height XX – 默认值:0 – 调整高度以粘贴
  • stability true/false – 默认值: true – 设置 false 以忽略稳定性系统
  • vending true/false – 默认值:false – 设置为粘贴自动售货机的销售、名称和广播
  • position x,y,z – 覆盖生成位置
  • rotation x – 默认值:0 – 更改旋转校正

其他

/undo – 删除您上次粘贴的内容/copylist – 结构列表(来自文件夹 oxide/data/copypaste)

权限

此插件使用权限系统。若要分配权限,请使用 。若要删除权限,请使用 。oxide.grant <user or group> <name or steam id> <permission>oxide.revoke <user or group> <name or steam id> <permission>
  • copypaste.copy
  • copypaste.list
  • copypaste.paste
  • copypaste.pasteback
  • copypaste.undo

配置

可以在目录下的文件中配置设置和选项。建议使用编辑器和验证器,以避免格式问题和语法错误。CopyPasteconfig
{
  "Amount of entities to paste per batch. Use to tweak performance impact of pasting": 15,
  "Amount of entities to copy per batch. Use to tweak performance impact of copying": 100,
  "Amount of entities to undo per batch. Use to tweak performance impact of undoing": 15,
  "Enable data saving feature": true,
  "Copy Options": {
    "Check radius from each entity (true/false)": true,
    "Share (true/false)": true,
    "Tree (true/false)": false
  },
  "Paste Options": {
    "Auth (true/false)": true,
    "Deployables (true/false)": true,
    "Inventories (true/false)": true,
    "Vending Machines (true/false)": true,
    "Stability (true/false)": true
  }
}

开发者 API

object TryCopyFromSteamId(ulong userID, string filename, string[] args)
object TryPasteFromSteamId(ulong userID, string filename, string[] args)
object TryPasteFromVector3(Vector3 pos, float rotationCorrection, string filename, string[] args)

失败时返回字符串,成功时返回 true

复制完成后调用OnCopyFinished(List<object> rawData, string filename, IPlayer player, Vector3 startPos)

粘贴完成后调用OnPasteFinished(List<BaseEntity> pastedEntities, string filename, IPlayer player, Vector3 startPos)

例:

Copy
bool BuyBuilding(BasePlayer player, string buildingName)
{
    var options = new List<string>{ "blockcollision", "true" };

    var success = CopyPaste.Call("TryPasteFromSteamID", player.userID, buildingName, options.ToArray());

    if(success is string)
    {
        SendReply(player, "Can't place the building here");

        return false;
    }

    SendReply(player, "You've successfully bought this building");

    return true;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。