How could we do something like:
[DOUBLEPOST=1424439601][/DOUBLEPOST]With a Static it works:Code:void CreateDefaultConfig() { commands.Test = "test"; }[ChatCommand(commands.Test)] //make ChatCommand read commands.Test or whatever is the option gave by you guys, so it will be possible to let the server owner choose its own commands.void cmdTest(BasePlayer player, string command, string[] args) { //some function here }
Code:public static class Global { public const string CommandTest = "test"; //change commands.Test from the ChatCommand to CommandTest seems to work! -- now I need to know how to store the "test" command from the config file inside this var }
[C#] ChatCommand based on Config File
Discussion in 'Rust Development' started by TheRotAG, Feb 20, 2015.