Bug Fixing Round 3

This commit is contained in:
Cooldude2606
2019-04-19 14:06:08 +01:00
parent 37e040c093
commit 53a74b96e3
12 changed files with 1042 additions and 18 deletions

View File

@@ -48,13 +48,12 @@ end)
Commands.new_command('clear-temp-ban','Removes temp ban from a player; this will not restore they items.')
:add_param('player',false,'player-role')
:add_param('reason',false)
:add_alias('untemp-ban','remove-temp-ban')
:enable_auto_concat()
:register(function(player,action_player,reason,raw)
:register(function(player,action_player,raw)
local action_player_name_color = format_chat_player_name(action_player)
local by_player_name_color = format_chat_player_name(player)
if JailControl.clear_temp_ban_player(action_player,player.name,reason) then
if JailControl.clear_temp_ban_player(action_player,player.name) then
game.print{'exp-commands.jail-temp-ban-clear',action_player_name_color,by_player_name_color}
else
return Commands.error{'exp-commands.jail-not-temp-banned',action_player_name_color}

View File

@@ -8,7 +8,7 @@ Commands.new_command('report','Reports a player and notifies moderators')
:add_param('player',false,function(input,player,reject)
input = Commands.parse('player',input,player,reject)
if not input then return end
if Roles.player_has_flag(player,'report-immune') then
if Roles.player_has_flag(input,'report-immune') then
return reject{'exp-commands.report-player-immune'}
else
return input
@@ -45,7 +45,8 @@ Commands.new_command('get-reports','Gets a list of all reports that a player has
Commands.print{'exp-commands.report-player-count-title'}
for player_name,reports in pairs(user_reports) do
local player_name_color = format_chat_player_name(player_name)
Commands.print{'exp-commands.report-list',player_name_color,#reports}
local report_count = ReportsControl.count_player_reports(player_name)
Commands.print{'exp-commands.report-list',player_name_color,report_count}
end
end
end)
@@ -55,7 +56,7 @@ Commands.new_command('clear-reports','Clears all reports from a player or just t
:add_param('from-player',true,'player')
:register(function(player,action_player,from_player,raw)
if from_player then
if not ReportsControl.remove_player_report(action_player,from_player) then
if not ReportsControl.remove_player_report(action_player,from_player.name) then
return Commands.error{'exp-commands.report-not-reported'}
end
else

View File

@@ -49,8 +49,8 @@ end)
Commands.new_command('clear-warnings','Clears all warnings (and script warnings) from a player')
:add_param('player',false,'player')
:register(function(player,action_player,raw)
WarningsControl.clear_warnings(player,player.name)
WarningsControl.clear_temp_warnings(player,player.name)
WarningsControl.clear_warnings(action_player,player.name)
WarningsControl.clear_temp_warnings(action_player,player.name)
local action_player_name_color = format_chat_player_name(action_player)
local by_player_name_color = format_chat_player_name(player)
game.print{'exp-commands.warnings-cleared',action_player_name_color,by_player_name_color}