mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
.
This commit is contained in:
@@ -25,6 +25,8 @@ local Commands = require("modules/exp_commands")
|
||||
local add, parse = Commands.add_data_type, Commands.parse_input
|
||||
local valid, invalid = Commands.status.success, Commands.status.invalid_input
|
||||
|
||||
local Roles = require("modules.exp_legacy.expcore.roles") --- @dep expcore.roles
|
||||
|
||||
local types = {} --- @class Commands._types
|
||||
|
||||
--- A boolean value where true is one of: yes, y, true, 1
|
||||
@@ -229,4 +231,29 @@ types.color =
|
||||
end
|
||||
end)
|
||||
|
||||
--- A player who has joined the game at least once, with a lower role
|
||||
types.lower_role_player =
|
||||
add("player", function(input, player)
|
||||
local player_i = game.get_player(input)
|
||||
local player = game.get_player(player)
|
||||
|
||||
if Roles.get_player_highest_role(player_i).index <= Roles.get_player_highest_role(player).index then
|
||||
return invalid{ "exp-commands-parse.player", input }
|
||||
else
|
||||
return valid(player)
|
||||
end
|
||||
end)
|
||||
|
||||
--- A role that is lower than given user
|
||||
types.lower_role =
|
||||
add("role", function(input)
|
||||
local player = game.get_player(input)
|
||||
|
||||
if Roles.config.roles[input] and (Roles.config.roles[input].index >= Roles.get_player_highest_role(player).index) then
|
||||
return valid(player)
|
||||
else
|
||||
return invalid{ "exp-commands-parse.role", input }
|
||||
end
|
||||
end)
|
||||
|
||||
return types
|
||||
|
||||
@@ -27,6 +27,7 @@ force=Invalid Force Name.
|
||||
surface=Invalid Surface Name.
|
||||
planet=Invalid Planet Name.
|
||||
color=Invalid Color Name.
|
||||
role=Invalid Role Name.
|
||||
|
||||
[exp-commands-authorities]
|
||||
character-only=This command can not be used in remote view.
|
||||
|
||||
@@ -27,6 +27,7 @@ force=勢力名稱錯誤。
|
||||
surface=地表名稱錯誤。
|
||||
planet=星球名稱錯誤。
|
||||
color=顏色名稱錯誤。
|
||||
role=權限組名稱錯誤。
|
||||
|
||||
[exp-commands-authorities]
|
||||
character-only=該命令不能在遠端視圖中使用。
|
||||
|
||||
@@ -27,6 +27,7 @@ force=勢力名稱錯誤。
|
||||
surface=地表名稱錯誤。
|
||||
planet=星球名稱錯誤。
|
||||
color=顏色名稱錯誤。
|
||||
role=權限組名稱錯誤。
|
||||
|
||||
[exp-commands-authorities]
|
||||
character-only=該命令不能在遠端視圖中使用。
|
||||
|
||||
Reference in New Issue
Block a user