Using Rusty or Rust:IO console it doesn't print anything. Why? Console commands are mean to work only in-game? Just wondering, because it offers me to use IPlayer parameter.Code:using UnityEngine;namespace Oxide.Plugins { [Info("EpicPlugin", "Unknown", "1.0.0")] [Description("A basic console command")] class EpicPlugin : CovalencePlugin { [Command("global.test")] void TestCommand(IPlayer player) { Puts("Test successful!"); } } }
Solved Universal console command not working (missing arguments)
Discussion in 'Rust Development' started by Pastori, Nov 11, 2016.
-
Wulf Community Admin
You're missing a couple of required arguments. The plugin likely errors without them, if you check your logs.Code:namespace Oxide.Plugins { [Info("EpicPlugin", "Unknown", "1.0.0")] [Description("A basic console command")] class EpicPlugin : CovalencePlugin { [Command("global.test")] void TestCommand(IPlayer player, string command, string[] args) { Puts("Test successful!"); } } } -
Wulf Community Admin
The command appears to be working, but pretty sure most RCON clients filter Oxide log messages. You can try player.Reply and see if that works instead. -
logs/oxide_2016-11-11.txt
Still same result. I cannot get it print anything to console. I'm trying Rusty and Rust:IO. Logs says that the command has been replaced as you see above, but I don't really know what's wrong. If RCON tool doesn't print it out in console. Should Oxide write it to logs that are located in "logs" folder of Oxide? If yes, then that was a result.Code:02:30 [Info] Unloaded plugin MyPlugin v1.0.0 by Pastori 02:30 [Info] Loaded plugin MyPlugin v1.0.0 by Pastori 02:30 [Warning] MyPlugin has replaced the 'test' command previously registered by MyPlugin
[DOUBLEPOST=1478828256][/DOUBLEPOST]PS. Replying to player didn't work. Same result. -
Wulf Community Admin
Oxide writes to the logs when you use Puts, so it would be there. Also, you can drop the global. from the command, it's automatic.
[DOUBLEPOST=1478828855,1478828658][/DOUBLEPOST]Working fine with my test:
-
![[IMG]](proxy.php?image=http%3A%2F%2Fimage.prntscr.com%2Fimage%2F4e8ee0ef28344330a5acf56a6b71045f.png&hash=e0135e795d85d891f305cc0ce33ffebb)
Thank you. I tried without a global before, but I had missing parameters when I tried without it.
By the way. Why API Docs is missing the parameters? -
Wulf Community Admin
Current Docs are a bit outdated.
