If the user is in a car or heli, when the rename happens the player is ejected from the vehicle.
Any idea if there is any way to not have this happen? Seems like it's a native issue with how rename works and not the plugin.
Rename ejects player from vehicleNot An Issue
That isn't from this plugin specifically, but the rename handling teleports the player in place to reset their name tag. For that to be fixed, we'd have to avoid teleporting then if mounted, which would prevent a full rename. This would be done in Oxide, not this plugin.
I've made some serious modifications to this rename plugin, but here's a sample of how I fixed it to hold off on the rename until they are no longer mounted. This is useful because while normally people wouldn't rename while they are mounted, my map is half RP half PVP, so I modified the plugin to rename people depending on which half of the map they are in, so if they were crossing between the 2 halves of the map in a heli, they would be ejected and die.
if (baseplayer.isMounted)
{
makeNewTimer(player, rename.New);
}
else
{
player.Rename(rename.New);
}
private void makeNewTimer(IPlayer player, string newName)
{
BasePlayer baseplayer = player.Object as BasePlayer;
timer.Once(10f, () =>
{
if (baseplayer.isMounted)
{
makeNewTimer(player, newName);
}
else
{
player.Rename(newName);
var pos = player.Position();
player.Teleport(pos.X, pos.Y, pos.Z);
}
});
} That change would assume they are going to unmount within 10 seconds, not holding off until they do. As I mentioned though, the change would be made in Oxide, not this plugin.
No, it makes a timer and checks in 10 seconds if they are still mounted, and if so it makes another timer to check in another 10 seconds, repeating until they are finally unmounted then it renames them. Seems to work fine for me :)Wulf
That change would assume they are going to unmount within 10 seconds, not holding off until they do. As I mentioned though, the change would be made in Oxide, not this plugin.
Ah right, missed that part. I'll take a look and see what can be done via the core.
Hello, i had seen it is not a Bug
-> https://umod.org/community/rename/32877-rename-ejects-player-from-vehicle
did you change something in the Core? or could we add the code from this thread?
We had also an RP Server :)
Thanks for your info