1. beans54321

    beans54321 Naked Wanderer

    Hello i im wondering if anyone can guild me in the right direction. I want to make a plugin that when u do /afk you %name% changes to AFK %name% so people know if your offline. I want it to show up when you hit escape any ideas?
    Thanks,
    BeAnZ
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    The example I gave you previously is most of the work, anymore and we'd be writing it for you. ;)
     
  3. beans54321

    beans54321 Naked Wanderer

    thx for help rn im coding a plugin this is a snip of it
    Code (Text):
                    [Command("afk")]
            void webCommand(IPlayer player, string command, string[] args)
            {
                server.Broadcast("User %name% is afk");
            }
    is there a way that the %name% can say the users name?
    also can i add a cooldown? thx for help
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    You'd need to rename them, not just send a chat message. I'm not sure how this is handled by Reign of Kings and we don't have that wrapped yet, so you'd likely have to do some digging in the Assembly-CSharp.dll from the game using a program such as JustDecompile.
     
  5. beans54321

    beans54321 Naked Wanderer

    I have used justdecompile and i still cant find a way i have also looked threw lots of rok plugins..
    player, {e.Player.DisplayName} both dont work... any one have an idea
     
  6. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Could you show me what you have right now with the code?
     
  7. beans54321

    beans54321 Naked Wanderer

    Code (Text):
    using System;
    using System.Collections.Generic;
    using CodeHatch.Networking.Events.Players;
    using Oxide.Core.Libraries.Covalence;
    using Oxide.Game.ReignOfKings.Libraries;
    using CodeHatch.Common;
    using CodeHatch.Engine.Networking;
    using CodeHatch.Networking.Events.Entities;
    using CodeHatch.Engine.Core.Cache;

    namespace Oxide.Plugins
    {
        [Info("CommandReply", "Wulf/lukespragg", "0.0.1")]
        [Description("Shows a reply on command usage")]

        class CommandReply : ReignOfKingsPlugin
        {
            [Command("teamspeak")]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
            player.Reply("The TeamSpeak server IP is: beanzgamingts3.ddns.net");
            }
                   [Command("afk")]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
            server.Broadcast(e.Player.DisplayName + "is afk.");
            }

        }  
    }
    Does it have something to do with
    Code (Text):
    void TeamSpeakCommand(IPlayer player, string command, string[] args)
    --- Double Post Merged, Dec 13, 2016 ---
    im confused because i looked at other code and it has e.Player.DisplayName
     
  8. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    You can't just plug a random variable into the command. IPlayer is from Oxide, the other hook for the throne is for Rust; they use entirely different things. If you want to use e.Player.DisplayName, you'd need to change to ReignOfKingsPlugin and remove the [Command] attributes and use [ChatCommand] instead as that is specific to Reign of Kings. Instead of IPlayer, you'd use Player from Reign of Kings.
     
  9. beans54321

    beans54321 Naked Wanderer

    so like this?
    Code (Text):
    using System;
    using System.Collections.Generic;
    using CodeHatch.Networking.Events.Players;
    using Oxide.Core.Libraries.Covalence;
    using Oxide.Game.ReignOfKings.Libraries;
    using CodeHatch.Common;
    using CodeHatch.Engine.Networking;
    using CodeHatch.Networking.Events.Entities;
    using CodeHatch.Engine.Core.Cache;

    namespace Oxide.Plugins
    {
        [Info("CommandReply", "Wulf/lukespragg", "0.0.1")]
        [Description("Shows a reply on command usage")]

        class CommandReply : ReignOfKingsPlugin
        {
            [ChatCommand(teamspeak)]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
            player.Reply("The TeamSpeak server IP is: beanzgamingts3.ddns.net");
            }
                   [ChatCommand("afk")]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
            player.Reply(e.Player.DisplayName + "is afk.");
            }

        }  
    }
     
  10. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    No, IPlayer would get replaced with Player, and player.Reply would have to get replaced with whatever specific ROK has for it.