thank you![]()

Copy Paste
Copy and paste your buildings to save them or move them
Total Downloads: 21,546 - First Release: Apr 3, 2015 - Last Update: Jun 14, 2018
- 5/5, 83 likes
-
@miRror please please please could you add a command to paste something into the center of an existing zone or to co ords?
-
-
This plus our town every wipe is why:
-
I haven't even downloaded the plugin yet, and I'm already excited to use it!
-
@miRror Any chance of that feature before out Sunday wipe?
-
-
Last edited by a moderator: Jun 21, 2017
-
-
/zonepaste zonename pastefilename
that would paste to the center of the zone. if so yes.
Presumably they'd paste with the same orientation so the existing spawn points wouldnt need to be redone (after the first time we used it) either, and poof, you would have cut over an hour out of our wipe set up -
-
If not I guess we could just keep moving the center of the closer to the water zone til we can use the function you mentioned before so that they paste in nicely. -
-
Wipin Sunday
-
everytime i try to copy a base it jsut crashes the server /copy base radius 40
-
Last edited by a moderator: Jun 24, 2017
-
-
miRror updated Copy Paste with a new update entry:
3.2.7
[DOUBLEPOST=1498492421][/DOUBLEPOST] -
@Corrosive test this:
http://joxi.ru/MAjMa8pI4KwPg2.png
PasteZone.cs:
Code:using Oxide.Core.Plugins; using System.Collections.Generic; using UnityEngine;namespace Oxide.Plugins { [Info("Paste Zone", "miRror", "1.0.0")] public class PasteZone : RustPlugin { [PluginReference] Plugin CopyPaste, ZoneManager; //Hooks private void Init() { Dictionary<string, Dictionary<string, string>> compiledLangs = new Dictionary<string, Dictionary<string, string>>(); foreach(var line in messages) { foreach(var translate in line.Value) { if(!compiledLangs.ContainsKey(translate.Key)) compiledLangs[translate.Key] = new Dictionary<string, string>(); compiledLangs[translate.Key][line.Key] = translate.Value; } } foreach(var cLangs in compiledLangs) { lang.RegisterMessages(cLangs.Value, this, cLangs.Key); } } //Chat commands [ChatCommand("pastezone")] private void cmdChatPasteZone(BasePlayer player, string command, string[] args) { if(args.Length < 2) { SendReply(player, Lang("FORMAT_PASTEZONE", player.UserIDString)); return; } Vector3 pos = (Vector3)ZoneManager.Call("GetZoneLocation", args[0]); if(pos == Vector3.zero) { SendReply(player, Lang("ZONE_NOT_EXISTS", player.UserIDString)); return; } List<string> options = new List<string>{ /* "auth", "true" */ }; var success = CopyPaste.Call("TryPasteFromVector3", pos, pos, args[1], options.ToArray()); if(success is string) { SendReply(player, Lang("PASTEZONE_FAILURE", player.UserIDString)); return; } SendReply(player, Lang("PASTEZONE_SUCCESS", player.UserIDString, args[0])); } //Other methods private string Lang(string key, string userID = null, params object[] args) => string.Format(lang.GetMessage(key, this, userID), args); //Languages phrases private readonly Dictionary<string, Dictionary<string, string>> messages = new Dictionary<string, Dictionary<string, string>> { {"FORMAT_PASTEZONE", new Dictionary<string, string>() { {"en", "Syntax: <color=orange>/pastezone ZONEID BUILDINGNAME</color>"}, {"ru", "Формат команды: <color=orange>/pastezone ZONEID BUILDINGNAME</color>"}, }}, {"ZONE_NOT_EXISTS", new Dictionary<string, string>() { {"en", "Zone by ID not found"}, {"ru", "Зона по указанному ID не найдена"}, }}, {"PASTEZONE_FAILURE", new Dictionary<string, string>() { {"en", "Error pasting"}, {"ru", "Ошибка вставки постройки"}, }}, {"PASTEZONE_SUCCESS", new Dictionary<string, string>() { {"en", "Buildings successful pasted in zone <color=orange>{0}</color>"}, {"ru", "Постройка успешно вставлена в зону <color=orange>{0}</color>"}, }}, }; } }
-
EDIT: Ah, found it, it pasted on the ground, zone is 3500 in the air (the second one is me trying it again). So yeh its not pasting in the center of a zone
Same thing happens at sea regardless of zone height
Code:(20:42:20) | Calling 'TryPasteFromVector3' on 'CopyPaste v3.2.6' took 1440ms (20:42:20) | Calling 'cmdChatPasteZone' on 'PasteZone v1.0.0' took 1442ms (20:44:00) | Calling 'cmdChatZone' on 'ZoneManager v2.4.20' took 244ms (20:44:20) | Calling 'TryPasteFromVector3' on 'CopyPaste v3.2.6' took 1184ms (20:44:20) | Calling 'cmdChatPasteZone' on 'PasteZone v1.0.0' took 1185ms (20:44:51) | Calling 'cmdChatZone' on 'ZoneManager v2.4.20' took 244ms (20:45:50) | Calling 'cmdChatZone' on 'ZoneManager v2.4.20' took 246ms
Last edited by a moderator: Jun 27, 2017