Solved Change name c#
Discussion in 'Rust Development' started by Sir BenSon, Nov 5, 2016.
-
NameChange for Rust | Oxide
Consider using the search function in future.
-
i tested it but its broken and lua is not an option for me
-
Try something like this:
Code:using System.Reflection;namespace Oxide.Plugins { class Name : RustPlugin { FieldInfo displayName = typeof(BasePlayer).GetField("_displayName", (BindingFlags.Instance | BindingFlags.NonPublic)); [ChatCommand("name")] private void NameChange(BasePlayer player, string command, string[] args) => displayName.SetValue(player, "NewName"); } } -
Ah the field in BasePlayer "_displayName" can changed to a string like i want?
-
No, you would change the string "NewName" to the new name you'd like. I haven't tested this yet, by the way.
-
Wulf Community Admin
You can also easily rename using Covalence: player.Rename(string newName).
