Fixed Some Admin Commands

This commit is contained in:
Cooldude2606
2018-11-09 15:44:01 +00:00
parent cd48647640
commit f988380096
9 changed files with 15 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ commands.add_command('jail', 'Jails a player', {
}, function(event,args)
local player = args.player
local reason = args.reason
if Role.allowed(player,'no-report') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
if Role.has_flag(player,'not_reportable') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
if Admin.is_banned(player) then player_return{'ExpGamingCore_Command.cant-report-ban',args.player} return commands.error end
Admin.jail(player,event.player_index,reason)
end)
@@ -23,6 +23,6 @@ commands.add_command('unjail', 'Returns a player\'s old rank', {
['player']={true,'player'}
}, function(event,args)
local player = args.player
if Admin.is_banned(player) then player_return({'ExpGamingCore_Command.cant-report-ban',args.player}) return commands.error end
if Admin.is_banned(player,true) ~= 'jail' then player_return({'ExpGamingCore_Command.cant-report-ban',args.player}) return commands.error end
Server.interface(Role.revert,true,player,event.player_index,2)
end)

View File

@@ -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 Role.allowed(player,'no-report') then player_return({'ExpGamingAdmin.cant-report',args.player}) return commands.error end
if Role.has_flag(player,'not_reportable') 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

@@ -10,6 +10,6 @@ commands.add_command('temp-ban', 'Temporarily ban a player', {
}, 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 Admin.is_banned(player) and Admin.is_banned(player,true) ~= 'jail' then player_return({'ExpGamingAdmin.cant-report-ban',args.player}) return commands.error end
Admin.temp_ban(player,event.player_index,reason)
end)

View File

@@ -12,7 +12,7 @@ commands.add_command('warn', 'Gives a player a warning', {
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 Role.allowed(player,'no-report') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
if Role.has_flag(player,'not_reportable') then player_return{'ExpGamingAdmin.cant-report',args.player} return commands.error end
Admin.give_warning(player,event.player_index,reason)
end)