1. is it possible like in rust it is ConsoleSystem.Run.Server.Quiet("",true);
     
  2. Wulf

    Wulf Community Admin

  3. thank you
     
  4. Wulf

    Wulf Community Admin

    Your plugin is set as HurtworldPlugin, the code example I gave was for a CovalencePlugin. If you don't want to do that, you'd need to use what I linked before the example.
     
  5. yeah figured it out you was too fast at replying is there any way i can do both in one plugin? because i want to make a teleporter so i would need to use a player command then run a server one but if not ill just reference one script from the other
     
  6. Wulf

    Wulf Community Admin

    I don't know of a way to run a client-side command yet. A CovalencePlugin is just a universal plugin for multiple games.
     
  7. oh there is a way that works fine but only in HurtworldPlugin but if i use CovalencePlugin i cannot use player commands
     
  8. Wulf

    Wulf Community Admin

    You should be able to.
     
  9. no i cant but i found a work around


    Code:
    [Info("HurtPK", "OwnProx", "1.0.0")]
        class HurtPK : HurtworldPlugin
        {
            class Server : CovalencePlugin
            {
                public void RunServerCommand(string cmd)
                {
                    server.RunCommand(cmd);
                }
            }
            Server s;
            private System.Timers.Timer timer1;
          
            void Loaded()
            {
                s = new Server();
             }void OnPlayerConnected(PlayerIdentity identity, uLink.NetworkPlayer player)
    {
                s.RunServerCommand("");
    }[ChatCommand("works")]
            void cmdWorks(PlayerIdentity player, NetworkMessageInfo info, string command, string[] args)
            {
    Puts("Works");
    }
    }
     
  10. Wulf

    Wulf Community Admin

    Your only issues is with Puts, which isn't available via CovalencePlugin. There is no issue with commands. Also, I'd recommend using Visual Studio 2015, as you're formatting could use some cleanup.
     
  11. my formatting is down to copying and pasting certain parts from the script and ending the open brackets myself hahah yeah but i should, and i did not have puts in it earlier it was just a example, i tried a command under CovalencePlugin where it sent a reply message to the client but ingame it say command not found but when i use a HurtworldPlugin and type the command in game it works

    thanks for your help
     
  12. Wulf

    Wulf Community Admin

    Ah, I'll have to look into that. There should be a way to register a command through Covalence, though it is a bit different.
     
  13. fyi to anyone just use a plugin reference saves time
     
    Last edited by a moderator: Dec 8, 2015
  14. Wulf

    Wulf Community Admin

    Yes, but that won't save between server restarts.
     
  15. Code:
    [ChatCommand("test")]
            void TestCommand(PlayerSession session, string command, string[] args)
            {
                    switch (args[0]) {
                            case: "as"
                                   covalence.Server.RunCommand("addadmin 123356652463");
                            break
                    }
            }
    Code:
    5:35 PM [Error] Failed to call hook 'TestCommand' on plugin 'Store v1.0.0' (InvalidCastException: Cannot cast from source type to destination type.)
    5:35 PM [Debug]   at Oxide.Game.Hurtworld.Libraries.Covalence.HurtworldServer.RunCommand (System.String command, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Store.StoreCommand (.PlayerSession session, System.String command, System.String[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Store.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
    Why? =\
     
  16. Wulf

    Wulf Community Admin

    I'll do some testing and see. There may be an issue with that. For now you can call directly using the code found at the link referenced in my first reply if you'd like.
     
  17. ConsoleManager.Instance.ExecuteCommand?
    idem