mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 04:06:39 +09:00
Added ExpGamingCommands.admin
This commit is contained in:
12
modules/ExpGamingCommands/admin/src/clear.lua
Normal file
12
modules/ExpGamingCommands/admin/src/clear.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local Admin = Admin
|
||||
|
||||
--- Clears a players inventory and moves it to chests in spawn
|
||||
-- @command clear-inv
|
||||
-- @param player the player to clear the inventory of
|
||||
commands.add_command('clear-inv', 'Clears a player\'s invetory', {
|
||||
['player'] = {true,'player-rank'}
|
||||
}, function(event,args)
|
||||
local player = args.player
|
||||
if Admin.is_banned(player) then player_return({'reports.cant-report-ban',args.player}) return commands.error end
|
||||
Admin.move_inventory(player)
|
||||
end)
|
||||
28
modules/ExpGamingCommands/admin/src/jail.lua
Normal file
28
modules/ExpGamingCommands/admin/src/jail.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local Admin = Admin
|
||||
local Ranking = require('ExpGamingCore.Ranking')
|
||||
|
||||
--- Used to jail a player which stops them from moving
|
||||
-- @command jail
|
||||
-- @param player the player to be jailed
|
||||
-- @param[opt] reason the reason the player was jailed
|
||||
commands.add_command('jail', 'Jails a player', {
|
||||
['player']={true,'player-rank'},
|
||||
['reason']={false,'string-inf'}
|
||||
}, function(event,args)
|
||||
local player = args.player
|
||||
local reason = args.reason
|
||||
if Ranking.get_rank(player):allowed('no-report') then player_return({'reports.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)
|
||||
|
||||
--- Used to unjail a player
|
||||
-- @command unjail
|
||||
-- @param player the player to unjail
|
||||
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({'commands.cant-report-ban',args.player}) return commands.error end
|
||||
Server.interface(Ranking.revert,true,player,event.player_index)
|
||||
end)
|
||||
29
modules/ExpGamingCommands/admin/src/report.lua
Normal file
29
modules/ExpGamingCommands/admin/src/report.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
local Admin = Admin
|
||||
local Ranking = require('ExpGamingCore.Ranking')
|
||||
|
||||
--- Reports a player
|
||||
-- @command report
|
||||
-- @param player the player to report
|
||||
-- @param[opt] reason the reason why the player was reported
|
||||
commands.add_command('report', 'Reports a player', {
|
||||
['player']={true,'player-rank'},
|
||||
['reason']={false,'string-inf'}
|
||||
}, function(event,args)
|
||||
local _player = Game.get_player(event)
|
||||
local player = args.player
|
||||
local reason = args.reason
|
||||
if Admin.is_banned(player) then player_return({'reports.cant-report-ban',args.player}) return commands.error end
|
||||
if Ranking.get_rank(player):allowed('no-report') then player_return({'reports.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({'reports.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({'reports.cant-report',args.player}) return commands.error end end
|
||||
Admin.report(player,event.player_index,reason)
|
||||
end)
|
||||
|
||||
--- Clears the reports of the player
|
||||
-- @command clear-reports
|
||||
-- @param player the player to clear the reports of
|
||||
commands.add_command('clear-reports', 'Clears a player\'s reports', {
|
||||
['player'] = {true,Admin.is_not_banned}
|
||||
}, function(event,args)
|
||||
Admin.clear_reports(args.player,event.player_index)
|
||||
end)
|
||||
24
modules/ExpGamingCommands/admin/src/tempban.lua
Normal file
24
modules/ExpGamingCommands/admin/src/tempban.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local Admin = Admin
|
||||
|
||||
--- Used to temp ban a player and give a reason
|
||||
-- @command temp-ban
|
||||
-- @param player the player to temp ban
|
||||
-- @param[opt] reason the reason for the ban
|
||||
commands.add_command('temp-ban', 'Temporarily ban a player', {
|
||||
['player']={true,'player-rank'},
|
||||
['reason']={false,'string-inf'}
|
||||
}, function(event,args)
|
||||
local player = args.player
|
||||
local reason = args.reason
|
||||
if Admin.is_banned(player) then player_return({'reports.cant-report-ban',args.player}) return commands.error end
|
||||
Admin.temp_ban(player,event.player_index,reason)
|
||||
end)
|
||||
|
||||
--- Used to clear all parts of a player, removing warnings, reports, jail and temp ban
|
||||
-- @command clear-all
|
||||
-- @param player the player to clear
|
||||
commands.add_command('clear-all', 'Clears a player of any temp-ban, reports or warnings', {
|
||||
['player']={true,'player'}
|
||||
}, function(event,args)
|
||||
Admin.clear_player(args.player,event.player_index)
|
||||
end)
|
||||
28
modules/ExpGamingCommands/admin/src/warnings.lua
Normal file
28
modules/ExpGamingCommands/admin/src/warnings.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local Admin = Admin
|
||||
local Ranking = require('ExpGamingCore.Ranking')
|
||||
|
||||
--- Gives a warning to a player
|
||||
-- @command warn
|
||||
-- @param player the player to give a warning to
|
||||
-- @param[opt] reason the reason the player was given a warning
|
||||
commands.add_command('warn', 'Gives a player a warning', {
|
||||
['player']={true,'player-rank'},
|
||||
['reason']={false,'string-inf'}
|
||||
}, function(event,args)
|
||||
local player = args.player
|
||||
local reason = args.reason
|
||||
if Admin.is_banned(player) then player_return({'reports.cant-report-ban',args.player}) return commands.error end
|
||||
if Ranking.get_rank(player):allowed('no-report') then player_return({'reports.cant-report',args.player}) return commands.error end
|
||||
Admin.give_warning(player,event.player_index,reason)
|
||||
end)
|
||||
|
||||
--- Clears the warning of a player
|
||||
-- @command clear-warnings
|
||||
-- @param player the player to clear the warning of
|
||||
commands.add_command('clear-warnings', 'Clears a player\'s warnings', {
|
||||
['player'] = {true,'player'}
|
||||
}, function(event,args)
|
||||
local player = args.player
|
||||
if Admin.is_banned(player) then player_return({'reports.cant-report-ban',args.player}) return commands.error end
|
||||
Admin.clear_warings(player,event.player_index)
|
||||
end)
|
||||
Reference in New Issue
Block a user