1. beans54321

    beans54321 Naked Wanderer

    hello thanks to wulf today i have learned some of the basics of c#. I have added some to the sample plugin he has let me use.
    Code (Text):
    using Oxide.Core.Libraries.Covalence;

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

        class CommandReply : CovalencePlugin
        {
            [Command("teamspeak")]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
                player.Reply("The TeamSpeak server IP is: beanzgamingts3.ddns.net");
            }
                    [Command("website")]
            void webCommand(IPlayer player, string command, string[] args)
            {
                player.Reply("www.website.com");
            }
        }  
    }
    But i now want to add this in
    Code (Text):
    void OnThroneCaptured(AncientThroneCaptureEvent e)
    {
        Puts("OnThroneCaptured works!");
    }
    I want it to print it to console and global chat so it will say Kill the king! or when he makes taxes higher it says you will allow taxes like that. any ideas....
     
  2. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    Code (C#):
    void OnThroneCaptured(AncientThroneCaptureEvent e)
    {
        server.Broadcast("Don't kill the king!");
    }
     
  3. beans54321

    beans54321 Naked Wanderer

    i dont have to create a var or anything? Also how do u know all of these commands the docs dont say enough
    --- Double Post Merged, Dec 11, 2016 ---
    Code (Text):
    using System;
    using System.Collections.Generic;
    using CodeHatch.Engine.Networking;
    using CodeHatch.Networking.Events.Entities;
    using CodeHatch.Engine.Core.Cache;
    using System.Linq;
    using Oxide.Core;
    using CodeHatch.Damaging;
    using Oxide.Core.Libraries.Covalence;

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

        class CommandReply : CovalencePlugin
        {
            [Command("teamspeak")]
            void TeamSpeakCommand(IPlayer player, string command, string[] args)
            {
                player.Reply("The TeamSpeak server IP is: beanzgamingts3.ddns.net");
            }
                    [Command("website")]
            void webCommand(IPlayer player, string command, string[] args)
            {
                player.Reply("www.website.com");
            }
        }
        {
            void OnThroneCaptured(AncientThroneCaptureEvent e)
            {
                server.Broadcast("Don't kill the king!");
            }
        }
    }
    /reload CommandReply
    then it says
    Plugin 'CommandReply' not reloaded

    it worked before i must of done something wrong.
     
  4. Wulf

    Wulf Community Admin Community Admin Oxide Developer

  5. beans54321

    beans54321 Naked Wanderer

  6. Wulf

    Wulf Community Admin Community Admin Oxide Developer

    You don't have the throne hook inside the actual class.