Update Command Lib

This commit is contained in:
Cooldude2606
2024-10-19 05:20:28 +01:00
parent 377fb69152
commit 88cd64e422
16 changed files with 710 additions and 513 deletions

View File

@@ -2,20 +2,21 @@
System command to execute a command as another player using their permissions (except for permissions group actions)
@commands _system-sudo
@usage-- Run the example command as another player
--- Run the example command as another player
-- As Cooldude2606: /repeat 5
/_system-sudo Cooldude2606 repeat 5
]]
local Commands = require("modules/exp_commands")
Commands.new("_sudo", "Run a command as another player")
Commands.new("_sudo", { "exp-commands-sudo.description" })
:add_flags{ "system_only" }
:enable_auto_concatenation()
:argument("player", "player")
:argument("command", "string-key", Commands.registered_commands)
:argument("arguments", "string")
:register(function(_, player, command, parameter)
:argument("player", { "exp-commands-sudo.arg-player" }, Commands.types.player)
:argument("command", { "exp-commands-sudo.arg-command" }, Commands.types.string_key(Commands.registered_commands))
:argument("arguments", { "exp-commands-sudo.arg-arguments" }, Commands.types.string)
:register(function(_player, player, command, parameter)
--- @diagnostic disable-next-line: invisible
return Commands._event_handler{
name = command.name,
tick = game.tick,