1. Hey, noob question can't find it in any plugins to learn from, how would I send a regular command to console like "server.hostname" for example
    [DOUBLEPOST=1423057420][/DOUBLEPOST]global.server.hostname = "newname"

    right?

    Ok I tested it and it works, I humour myself sometimes... sorry for post :p
    [DOUBLEPOST=1423057849][/DOUBLEPOST]Although that method isn't exactly ideal for what I need, i need it to parse through a file and execute console commands line by line.
     
    Last edited by a moderator: Feb 4, 2015
  2. server.hostname = "newname" in console
    global.server.hostname = "newname" in plugin yes
     
  3. What I'm hoping to achieve is this

    rust.SendConsoleCommand('say Hello')
    rust.SendConsoleCommand('server.hostname New Name')
    rust.SendConsoleCommand('event.run')

    Just don't know what hook to use exactly
     
  4. hmm that's not how
    in a plugin you probably would need:
    global.server.hostname "new name"

    event.run, very hard to do
    easiest way would be to recreate what it does
    (some exemples on how to spawn an airdrop are out there)

    and say it would be:
    rust.BroadcastChat("The Name", "The Message here");
     
  5. Wulf

    Wulf Community Admin

    This is the function you are looking for:
    Code:
    rust.RunServerCommand("server.hostname", "New name here")
     
  6. oh ... lol didnt know this one
     
  7. Wulf

    Wulf Community Admin

    I added it recently in one of the builds.
     
  8. With my help to lol
     
  9. Wulf

    Wulf Community Admin

    Yup, thanks. :)
     
  10. Thank you all :)
     
  11. erm... maybe a stupid thing for most of u, but I tried RunServerCommand and rust.RunServerCommand on C# without success... :(
     
  12. Wulf

    Wulf Community Admin

  13. How would you use this with multiple arguments, would this be correct: rust.RunServerCommand("banid", "76500000000000", "Playername", "Reason For Ban")

    Seems no, as it requires an object -.- can an example be provided please oh wulfyness?
     
  14. Wulf

    Wulf Community Admin

    Code:
    rust.RunServerCommand("banid", "\"76500000000000\" \"Playername\" \"Reason For Ban\""
     
  15. Does it need " in the string? So far I've just had to load up the args array and it works. Also I posted asking about what IDE you guys are using to use this class. Not sure what happened to it.
    [DOUBLEPOST=1425927051][/DOUBLEPOST]I guess a better question would be how do I call the function from another class?

    here are some things i tried for testing to no avail

    Code:
    Rust.RunServerCommand("inventory.give", new string[] {"stones", "1000000"});
    
    Code:
    ConsoleSystem.Run.Server.Normal("inventory.give stones 1000000");
    
    All of them tried with the rust.cs file in the same directory and the following included in the headers.

    Code:
    using Oxide.Rust.Libraries;
    
    Any help would be much appreciated!
     
  16. Wulf

    Wulf Community Admin

    If using CSharp, you can call the Rust functions directly instead of using the Oxide libraries. You were close with the ConsoleSystem snippet. https://github.com/OxideMod/Oxide/blob/master/Oxide.Ext.Rust/Libraries/Rust.cs#L65

    Don't put Oxide files in your folder as plugins, just reference them properly with magic comments at the top of your file.
    Code:
    // Reference: Oxide.Ext.Rust
    If referencing Rust, I believe you'll also need this to add "using Rust;
     
  17. I have the comment at the top //Reference: Oxide.Ext.Rust

    I added using Rust; which did not fix it. It compiles just fine, I also don't get an error when running the command but it doesn't give me the stone haha!
    Code:
            [ChatCommand("startkit")]
            void cmdChatStartKit(BasePlayer player, string command, string[] args)
            {
                ConsoleSystem.Run.Server.Normal("inventory.give", new string[] {"stones", "1000000"});
            }