mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Fixed roles list
This commit is contained in:
@@ -22,7 +22,7 @@ return {
|
||||
'modules.addons.advanced-starting-items',
|
||||
'modules.addons.spawn-area',
|
||||
'modules.addons.compilatron',
|
||||
'modules.addons.worn-paths',
|
||||
'modules.addons.scorched-earth',
|
||||
-- Config Files
|
||||
'config.command_auth_admin', -- commands tagged with admin_only are blocked for non admins
|
||||
'config.command_auth_roles', -- commands must be allowed via the role config
|
||||
|
||||
@@ -9,5 +9,6 @@ chelp-format=/__1__ __2__ - __3__ __4__
|
||||
chelp-alias=Alias: __1__
|
||||
chelp-out-of-range=__1__ is an invalid page number.
|
||||
roles-higher-role=The role you tried to assign is higher than your highest.
|
||||
roles-list=All roles are:
|
||||
roles-list=All roles are: [color=__1__]__2__
|
||||
roles-list-player=[color=__1__]__2__ has: [color=__3__]__4__
|
||||
roles-list-element=__1__, [color=__2__]__3__
|
||||
@@ -32,18 +32,27 @@ end)
|
||||
|
||||
Commands.new_command('list-roles','Lists all roles in they correct order')
|
||||
:add_param('player',true,'player')
|
||||
:add_alias('lroles','roles')
|
||||
:add_alias('lsroles','roles')
|
||||
:register(function(player,action_player,raw)
|
||||
local roles = Roles.config.order
|
||||
if action_player then
|
||||
local message = {'exp-commands.roles-list'}
|
||||
if action_player ~= '' then
|
||||
roles = Roles.get_player_roles(action_player)
|
||||
end
|
||||
local message = {'exp-commands.roles-list'}
|
||||
for _,role_name in pairs(roles) do
|
||||
local role = Roles.get_role_by_name(role_name)
|
||||
for index,role in pairs(roles) do
|
||||
role = Roles.get_role_from_any(role)
|
||||
local colour = role.custom_color or Colours.white
|
||||
colour = string.format('%d,%d,%d',colour.r,colour.g,colour.b)
|
||||
message = {'exp-commands.roles-list-element',message,colour,role_name}
|
||||
if index == 1 then
|
||||
message = {'exp-commands.roles-list',colour,role.name}
|
||||
if action_player ~= '' then
|
||||
local player_colour = action_player.color
|
||||
player_colour = string.format('%d,%d,%d',player_colour.r*255,player_colour.g*255,player_colour.b*255)
|
||||
message = {'exp-commands.roles-list-player',player_colour,action_player.name,colour,role.name}
|
||||
end
|
||||
else
|
||||
message = {'exp-commands.roles-list-element',message,colour,role.name}
|
||||
end
|
||||
end
|
||||
return Commands.success(message)
|
||||
end)
|
||||
Reference in New Issue
Block a user