diff --git a/Addons/Guis/player-list.lua b/Addons/Guis/player-list.lua index bd9b8734..c572a262 100644 --- a/Addons/Guis/player-list.lua +++ b/Addons/Guis/player-list.lua @@ -73,6 +73,11 @@ Gui.left.add{ caption={'player-list.format',tick_to_display_format(player.online_time),player.name,rank.short_hand} }.style.font_color = rank.colour end + if Admin.report_btn then + local btn = Admin.report_btn:draw(flow) + btn.style.height = 20 + btn.style.width = 20 + end end end end, diff --git a/Addons/Guis/reports.lua b/Addons/Guis/reports.lua new file mode 100644 index 00000000..f0e58ee1 --- /dev/null +++ b/Addons/Guis/reports.lua @@ -0,0 +1,53 @@ +--[[ +Explosive Gaming + +This file can be used with permission but this and the credit below must remain in the file. +Contact a member of management on our discord to seek permission to use our code. +Any changes that you may make to the code are yours but that does not make the script yours. +Discord: https://discord.gg/r6dC2uK +]] +--Please Only Edit Below This Line----------------------------------------------------------- + +local confirm_report = Gui.inputs.add{ + type='button', + name='admin-report-confirm', + caption='utility/spawn_flag' +}:on_event('click',function(event) + local parent = evet.element.parent + local player = Game.get_player(parent.player.caption) + local reason = parent.reason.text + Admin.report(player,event.player_index,reason) +end) + +Admin.report_btn = Gui.inputs.add{ + type='button', + name='admin-report', + caption='utility/spawp_flag' +}:on_event('click',function(event) + local parent = event.element.parent + local player = nil + for name,_ in pairs(parent.children) do + if name ~= 'admin-report' then + player = Game.get_player(name) + break + end + end + if not player then return end + local _player = Game.get_player(event) + Gui.center.clear(_player) + local frame = Gui.center.get_flow(_player).add{ + type='frame', + name='report-gui' + } + frame.caption={'reports.name'} + frame.add{ + type='textfield', + name='reason' + }.style.width = 300 + confirm_report:draw(frame) + frame.add{ + type='label', + name='player', + caption=player.name + }.style.visible = false +end) \ No newline at end of file diff --git a/Addons/load.lua b/Addons/load.lua index e46cb932..45af3c1f 100644 --- a/Addons/load.lua +++ b/Addons/load.lua @@ -41,5 +41,6 @@ require('Guis/tasklist') require('Guis/rank-changer') require('Guis/admin-gui') -- used with Admin/admin, requires Admin/admin require('Guis/game-settings') +require('Guis/reports') -- requires Admin/reports -- other \ No newline at end of file diff --git a/locale/en/reports.cfg b/locale/en/reports.cfg index 9cbe2551..b0152d44 100644 --- a/locale/en/reports.cfg +++ b/locale/en/reports.cfg @@ -1,4 +1,5 @@ [reports] +name=Report Player low-print=__1__ has been reported by a user for: __2__ high-print=__1__ has been reported by __2__ for: __3__ cant-report=This player cant be reported.