Converted Modules To Use Roles

This commit is contained in:
Cooldude2606
2018-09-29 17:28:07 +01:00
parent 96784009b6
commit e50bd509f8
48 changed files with 277 additions and 1146 deletions

View File

@@ -1,5 +1,5 @@
local Admin = Admin
local Ranking = require('ExpGamingCore.Ranking')
local Role = require('ExpGamingCore.Role')
--- Used to jail a player which stops them from moving
-- @command jail
@@ -11,8 +11,8 @@ commands.add_command('jail', 'Jails a player', {
}, function(event,args)
local player = args.player
local reason = args.reason
if Ranking.get_rank(player):allowed('no-report') then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end
if Admin.is_banned(player) then player_return({'commands.cant-report-ban',args.player}) return commands.error end
if Role.allowed(player,'no-report') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
if Admin.is_banned(player) then player_return{'commands.cant-report-ban',args.player} return commands.error end
Admin.jail(player,event.player_index,reason)
end)
@@ -24,5 +24,5 @@ commands.add_command('unjail', 'Returns a player\'s old rank', {
}, function(event,args)
local player = args.player
if Admin.is_banned(player) then player_return({'commands.cant-report-ban',args.player}) return commands.error end
Server.interface(Ranking.revert,true,player,event.player_index)
Server.interface(Role.revert,true,player,event.player_index,2)
end)

View File

@@ -1,5 +1,5 @@
local Admin = Admin
local Ranking = require('ExpGamingCore.Ranking@^4.0.0')
local Role = require('ExpGamingCore.Role@^4.0.0')
--- Reports a player
-- @command report
@@ -13,7 +13,7 @@ commands.add_command('report', 'Reports a player', {
local player = args.player
local reason = args.reason
if Admin.is_banned(player) then player_return({'ExpGamingAdmin.cant-report-ban',args.player}) return commands.error end
if Ranking.get_rank(player):allowed('no-report') then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end
if Role.allowed(player,'no-report') then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end
for _,report in pairs(global.addons.reports.reports) do if report[1] == _player.name then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end end
for _,report in pairs(global.addons.reports.varified) do if report[1] == _player.name then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end end
Admin.report(player,event.player_index,reason)

View File

@@ -1,5 +1,5 @@
local Admin = Admin
local Ranking = require('ExpGamingCore.Ranking@^4.0.0')
local Role = require('ExpGamingCore.Role@^4.0.0')
--- Gives a warning to a player
-- @command warn
@@ -11,8 +11,8 @@ commands.add_command('warn', 'Gives a player a warning', {
}, function(event,args)
local player = args.player
local reason = args.reason
if Admin.is_banned(player) then player_return({'ExpGamingAdmin.cant-report-ban',args.player}) return commands.error end
if Ranking.get_rank(player):allowed('no-report') then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end
if Admin.is_banned(player) then player_return{'ExpGamingAdmin.cant-report-ban',args.player} return commands.error end
if Role.allowed(player,'no-report') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
Admin.give_warning(player,event.player_index,reason)
end)