1. How teleport player without: sleeping and kicking violation level.
    My code
    Code:
    player.Teleport(pos)
     
  2. Create function like this, and use it to teleport player.
    Code:
    public void Teleport(BasePlayer player, Vector3 position)
            {
                if (player.net?.connection != null)
                    player.ClientRPCPlayer(null, player, "StartLoading", null, null, null, null, null);
                if (player.IsSleeping())
                    return;
                player.SetPlayerFlag(BasePlayer.PlayerFlags.Sleeping, true);
                if (!BasePlayer.sleepingPlayerList.Contains(player))
                    BasePlayer.sleepingPlayerList.Add(player);
                player.CancelInvoke("InventoryUpdate");
                player.MovePosition(position);
                if (player.net?.connection != null)
                    player.ClientRPCPlayer(null, player, "ForcePositionTo", position);
                if (player.net?.connection != null)
                    player.SetPlayerFlag(BasePlayer.PlayerFlags.ReceivingSnapshot, true);
                player.UpdateNetworkGroup();
                player.SendNetworkUpdateImmediate(false);
                if (player.net?.connection == null) return;
                try
                {
                    player.ClearEntityQueue(null);
                }
                catch
                {
                }
                player.SendFullSnapshot();
            }
    
    For my plugins, i created individual plugin for functions like this. And use hookmethod to call it from anywhere from other plugins.
     
  3. Wulf

    Wulf Community Admin

    Oxide's API has numerous methods to make use of teleporting, you don't really need to duplicate it. Look in the Libraries in our GitHub repo for Oxide.Game.Rust. Both the Covalence API and the game-specific API has methods for this.