How would I execute multiple commands with just one command. So basically I do /clearall for example and then it will automatically run commands of other plugins that i set.
Solved Executing multiple commands with one? (Lua)
Discussion in 'Rust Development' started by JohnRU, Jul 23, 2015.
-
Wulf Community Admin
The below example assumes you want both a chat and console command, and even though arguments are passed in the MyCommand function, my example is not using them. You can remove them if you end up not needing them.
Code:function PLUGIN:Init() command.AddChatCommand("mycmd", self.Plugin, "MyCommand") command.AddConsoleCommand("global.mycmd", self.Plugin, "MyCommand") endfunction PLUGIN:MyCommand(player, cmd, args) rust.RunServerCommand("command1") rust.RunServerCommand("command2 intexample") rust.RunServerCommand("command3 \"quote example\"") rust.RunServerCommand("command4 \"multi quote\" \"example\"") end
-
-
Wulf Community Admin
-
-
Wulf Community Admin