Added Commands to roles

This commit is contained in:
Cooldude2606
2019-04-18 23:40:55 +01:00
parent cc64613f41
commit 745e31b7e7
3 changed files with 31 additions and 9 deletions

View File

@@ -33,12 +33,14 @@ Roles.new_role('System','SYS')
:set_permission_group('Admin') :set_permission_group('Admin')
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_allow_all() :set_allow_all()
Roles.new_role('Senior Administrator','SAdmin') Roles.new_role('Senior Administrator','SAdmin')
:set_permission_group('Admin') :set_permission_group('Admin')
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Administrator') :set_parent('Administrator')
:allow{ :allow{
'command/interface', 'command/interface',
@@ -50,6 +52,7 @@ Roles.new_role('Administrator','Admin')
:set_custom_color{r=233,g=63,b=233} :set_custom_color{r=233,g=63,b=233}
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Moderator') :set_parent('Moderator')
:allow{ :allow{
} }
@@ -59,10 +62,19 @@ Roles.new_role('Moderator','Mod')
:set_custom_color{r=0,g=170,b=0} :set_custom_color{r=0,g=170,b=0}
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Trainee') :set_parent('Trainee')
:allow{ :allow{
'command/assign-role', 'command/assign-role',
'command/unassign-role' 'command/unassign-role',
'command/repair',
'command/kill/always',
'command/tag-clear/always',
'command/go-to-spawn/always',
'command/clear-reports',
'command/clear-warnings',
'command/clear-temp-ban',
'command/clear-inventory',
} }
Roles.new_role('Trainee','TrMod') Roles.new_role('Trainee','TrMod')
@@ -70,14 +82,17 @@ Roles.new_role('Trainee','TrMod')
:set_custom_color{r=0,g=170,b=0} :set_custom_color{r=0,g=170,b=0}
:set_flag('is_admin') :set_flag('is_admin')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Donator') :set_parent('Donator')
:allow{ :allow{
'command/admin-chat', 'command/admin-chat',
'command/teleport', 'command/teleport',
'command/bring', 'command/bring',
'command/goto', 'command/goto',
'command/kill/always', 'command/temp-ban',
'command/tag-clear/always', 'command/give-warning',
'command/get-warning',
'command/get-reports',
} }
--- Trusted Roles --- Trusted Roles
@@ -85,6 +100,7 @@ Roles.new_role('Sponsor','Spon')
:set_permission_group('Trusted') :set_permission_group('Trusted')
:set_custom_color{r=247,g=246,b=54} :set_custom_color{r=247,g=246,b=54}
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Pay to Win') :set_parent('Pay to Win')
:allow{ :allow{
} }
@@ -93,6 +109,7 @@ Roles.new_role('Pay to Win','P2W')
:set_permission_group('Trusted') :set_permission_group('Trusted')
:set_custom_color{r=238,g=172,b=44} :set_custom_color{r=238,g=172,b=44}
:set_flag('is_spectator') :set_flag('is_spectator')
:set_flag('report-immune')
:set_parent('Donator') :set_parent('Donator')
:allow{ :allow{
} }
@@ -111,6 +128,8 @@ Roles.new_role('Partner','Part')
:set_flag('is_spectator') :set_flag('is_spectator')
:set_parent('Veteran') :set_parent('Veteran')
:allow{ :allow{
'command/jail',
'command/unjail'
} }
Roles.new_role('Veteran','Vet') Roles.new_role('Veteran','Vet')
@@ -138,7 +157,10 @@ Roles.new_role('Regular','Reg')
:set_custom_color{r=79,g=155,b=163} :set_custom_color{r=79,g=155,b=163}
:set_parent('Guest') :set_parent('Guest')
:allow{ :allow{
'command/kill' 'command/kill',
'command/rainbow',
'command/go-to-spawn',
'command/me',
} }
:set_auto_promote_condition(function(player) :set_auto_promote_condition(function(player)
if player.online_time > 3*216000 then if player.online_time > 3*216000 then
@@ -151,12 +173,11 @@ local default = Roles.new_role('Guest','')
:set_permission_group('Guest') :set_permission_group('Guest')
:set_custom_color{r=185,g=187,b=160} :set_custom_color{r=185,g=187,b=160}
:allow{ :allow{
'command/me',
'command/tag', 'command/tag',
'command/tag-clear', 'command/tag-clear',
'command/chelp', 'command/chelp',
'command/list-roles', 'command/list-roles',
'command/rainbow' 'command/report',
} }
--- Jail role --- Jail role

View File

@@ -1,17 +1,18 @@
local Colours = require 'resources.color_presets' local Colours = require 'resources.color_presets'
local Game = require 'utils.game' local Game = require 'utils.game'
local Event = require 'utils.events' local Event = require 'utils.event'
local config = require 'config.preset_player_colours' local config = require 'config.preset_player_colours'
local Global = require 'utils.global' local Global = require 'utils.global'
require 'utils.table' require 'utils.table'
Global.reigster(config,function(tbl) Global.register(config,function(tbl)
config = tbl config = tbl
end) end)
local white = Colours.white local white = Colours.white
local black = Colours.black local black = Colours.black
Event.add(defines.events.on_player_created,function(event) Event.add(defines.events.on_player_created,function(event)
local player = Game.get_player_by_index(event.player_index)
local color = 'white' local color = 'white'
if config.players[player.name] then if config.players[player.name] then
color = config.players[player.name] color = config.players[player.name]

View File

@@ -46,7 +46,7 @@ Commands.new_command('get-warnings','Gets the number of warnings a player has. I
end end
end) end)
Commands.new_command('clear-warnigns','Clears all warnings (and script warnings) from a player') Commands.new_command('clear-warnings','Clears all warnings (and script warnings) from a player')
:add_param('player',false,'player') :add_param('player',false,'player')
:register(function(player,action_player,raw) :register(function(player,action_player,raw)
WarningsControl.clear_warnings(player,player.name) WarningsControl.clear_warnings(player,player.name)