To create a command inside the Config file you would append a new command object to Config.Commands (Use exports.TrainSportation.addCommand(name, func) outside. I didn’t test this it should work if it doesn’t let me know…)
Example:
somecustomcommand: (args, go, here) => {
if (self.help) { // the help command will set this to true. Then call every func to get this message in /smhelp
emitNet('chatMessage', self.source, "Help", [0, 255, 0], '/rmrestart <resourcename> [Restart resource]'); return;
}
}
/somecustomcommand sdasd 123123 "something with spaces"
@Boss Why do I use Command Processor it in this resource? It’s a good system, the only downside is that it changes the chat resource. Although it’s not a giant change!
@Boss Why do I use Command Processor it in this resource? It’s a good system, the only downside is that it changes the chat resource. Although it’s not a giant change!
When i try typing in the commands it doesnt do or show anything, i got command processor and the playervar installed properly and resources load no problems
I don’t completely understand how to install it I dragged the Server management and the player var and the cmd processor into the resources folder and added them to the server yml, it says it loads it but when I get in game, i do /smhelp and nothing happens.
Updated Command Proccessor (No need to replace chat anymore)
Removed GUID deprecation, uses GetPlayerIdentifiers now
Everything should be working as of 5/4/2017
Going to make the main post look nicer (maybe)
Update:
Added resource management commands to the trusted permission [/rmstart /rmstop /rmrestart]
giving people in the trusted list the ability to start and stop resources in-game.