Unable to get positionSolved
using uMod.Common;
using uMod.Common.Command;
using uMod.Configuration.Toml;

namespace uMod.Plugins
{
    [Info("AdminCommand", "Nathan", "1.0.0")]
    [Description("Toutes les commandes du serveur pour l'administration")]
    public class AdminCommand : Plugin
    {
        #region Commands
        [Command("retour")]
        private void TeleportUndo(IPlayer player, IArgs args)
        {
            if(player.IsAdmin) {
                    GenericPosition position = player.Position()
                    player.Teleport(position);
            }
        }

        #endregion
    }
}

And i have this error on loading the plugin :

GenericPosition should be Position. Your code will not work though, there is no teleporting like that.

Can i get x,y,z from the variable position, if yes, how ?

player.Position().X
player.Position().Y
player.Position().Z
using uMod.Common;
using uMod.Common.Command;
using uMod.Configuration.Toml;

namespace uMod.Plugins
{
    [Info("AdminCommand", "Nathan", "1.0.0")]
    [Description("Toutes les commandes du serveur pour l'administration")]
    public class AdminCommand : Plugin
    {
        #region Commands
        [Command("retour")]
        private void TeleportUndo(IPlayer player, IArgs args)
        {
            if(player.IsAdmin) {
                    player.Reply($"{player.Position.X}");
                    player.Teleport(player.Position.X, player.Position.Y, player.Position.Z);
            }
        }

        #endregion
    }
}

Its does'nt work and i have no error and the reply is not considered

As I mentioned above, you won't be able to teleport with that.

Also, if you don't see a reply, the user isn't consider admin.

Could you make me an example pls..

Ck1cPDlavgpyO2v.jpg Wulf

As I mentioned above, you won't be able to teleport with that.

Also, if you don't see a reply, the user isn't consider admin.

If i send "test" in the reply, the reply working

For the position, you are missing () after Position, that's all. There is no way to teleport via the server at the moment with just that.

using uMod.Common;
using uMod.Common.Command;
using uMod.Common.Database;
using uMod.Configuration.Toml;
using System.Collections.Generic;

namespace uMod.Plugins
{
    [Info("Teleport", "Nathan", "0.1.0")]
    [Description("Systeme de TP pour Valheim")]
    class Teleport : Plugin
    {
        [Command("tp")]
        private void TeleportToCoords(IPlayer player, IArgs args)
        {
            float x = 1;
            float y = 2;
            float z = 3;
            player.Teleport(x, y, z);
        }
    }
}

Not working, no error can you help me pls ?

As I said previously, you won't be able to teleport.

Oh sorry, thx for helping

Locked automatically