can someone tell me why im still getting "Unknown command" Ps Idk csharp so dont roast me lolCode:using Facepunch; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Threading; using UnityEngine; using UnityEngine.SceneManagement;namespace Oxide.Plugins { [Info("TestingCmds", "Alpha", 0.1)] [Description("test")] class TestingCmds : RustPlugin { [Command("cmdtest")] void TestCommand(IPlayer player) { } } }
Solved Can't get a command to register
Discussion in 'Rust Development' started by GreenArrow, Apr 18, 2017.
-
Wulf Community Admin
You are trying to use the CovalancePlugin [Command] attribute with a RustPlugin, which won't work. For the [Command] attribute to work, you'd have to switch to being a CovalencePlugin, else use the [ChatCommand] attribute with the associated method arguments.
-
Code:
using Facepunch; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Threading; using UnityEngine; using UnityEngine.SceneManagement;namespace Oxide.Plugins { [Info("TestingCmds", "Alpha", 0.1)] [Description("test")] class TestingCmds : RustPlugin { [ChatCommand("cmdtest")] void TestCommand(IPlayer player) { } } }
-
Wulf Community Admin
Code:[ChatCommand("cmdtest")] void TestCommand(BasePlayer player, string command, string[] args) { }
-
Still doesn't seem to work
-
Wulf Community Admin
-
-
Wulf Community Admin
-
-
Wulf Community Admin
-
I found the problem XD sorry me being dumb it works now thanks for your help "my file had the wrong name and my console didnt show that smh"
-
-
Wulf Community Admin
Code:[ConsoleCommand("cmdtest")] void TestCommand(ConsoleSystem.Arg arg) { }
-
It says The type or namespace ConsoleSystem could not be found. Do I need a Using statement? -
Wulf Community Admin
-
[DOUBLEPOST=1523496187][/DOUBLEPOST] -
Wulf Community Admin
-
Found it. Thank you!
-
I hate to do this Wulf, but I am STUCK on another topic. Trying to reduce Sulfur Ore nodes while keeping all other spawn items default. Can you check this and give me your thoughts? OnEntitySpawned - is there something called before?
-
Wulf Community Admin