mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
26 lines
802 B
Lua
26 lines
802 B
Lua
--[[-- Command Module - Sudo
|
|
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
|
|
-- As Cooldude2606: /repeat 5
|
|
/_system-sudo Cooldude2606 repeat 5
|
|
]]
|
|
|
|
local Commands = require("modules/exp_commands")
|
|
|
|
Commands.new("_sudo", "Run a command as another player")
|
|
: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)
|
|
return Commands._event_handler{
|
|
name = command.name,
|
|
tick = game.tick,
|
|
player_index = player.index,
|
|
parameter = parameter
|
|
}
|
|
end)
|