diff --git a/config/action_buttons.lua b/config/action_buttons.lua index 9bf8de57..4e821e1f 100644 --- a/config/action_buttons.lua +++ b/config/action_buttons.lua @@ -9,7 +9,7 @@ local Store = require 'expcore.store' local Game = require 'utils.game' local Reports = require 'modules.control.reports' local Warnings = require 'modules.addons.warnings-control' -local Jail = require 'modules.addons.jail-control' +local Jail = require 'modules.control.jail' local Colors = require 'resources.color_presets' local format_chat_player_name = ext_require('expcore.common','format_chat_player_name') @@ -146,7 +146,7 @@ Gui.new_button() :set_style('tool_button',tool_button_style) :on_click(function(player,element) local action_player_name,action_player_name_color = get_action_player_name(player) - if Roles.player_has_role(action_player_name,'Jail') then + if Jail.is_jailed(action_player_name) then player.print({'expcom-jail.already-jailed',action_player_name_color},Colors.orange_red) else Store.set(action_name_store,player.name,'command/jail') @@ -157,7 +157,7 @@ local function jail_player_callback(player,reason) local action_player_name,action_player_name_color = get_action_player_name(player) local by_player_name_color = format_chat_player_name(player) game.print{'expcom-jail.give',action_player_name_color,by_player_name_color,reason} - Jail.jail_player(action_player_name,player.name) + Jail.jail_player(action_player_name,player.name,reason) end -- temp bans the action player, requires a reason @@ -168,7 +168,7 @@ Gui.new_button() :set_style('tool_button',tool_button_style) :on_click(function(player,element) local action_player_name,action_player_name_color = get_action_player_name(player) - if Roles.player_has_role(action_player_name,'Jail') then + if Jail.is_jailed(action_player_name) then player.print({'expcom-jail.already-banned',action_player_name_color},Colors.orange_red) else Store.set(action_name_store,player.name,'command/temp-ban') diff --git a/doc/index.html b/doc/index.html index 36d76e1a..13ec6e62 100644 --- a/doc/index.html +++ b/doc/index.html @@ -274,6 +274,11 @@
Control Module - Jail + Adds a way to jail players and temp ban players.
+ + + + + + + +
+ -- This will move 'MrBiter' to the jail role and remove all other roles from them
+ -- the player name and reason are only so they can be included in the event for user feedback
+ Jail.jail_player('MrBiter','Cooldude2606','Likes biters too much')
+
+ -- This will give 'MrBiter' all his roles back and remove him from jail
+ -- again as above the player name is only used in the event for user feedback
+ Jail.unjail_player('MrBiter','Cooldude2606')
+
+ -- Temp ban works the same as jail but will store the reason and move the players items to spawn
+ -- this is meant to be used as a more permiment jail but not as strong as a ban
+ Jail.temp_ban_player('MrBiter','Cooldude2606','Likes biters too much')
+
+
+
+
+
+ | on_player_jailed | +When a player is assigned to jail | +
| on_player_temp_banned | +When a player is temp banned | +
| on_player_unjailed | +When a player is unassigned from jail | +
| on_player_untemp_banned | +When a temp ban is removed from a player | +
| is_jailed (player) | +Checks if the player is currently in jail | +
| jail_player (player, by_player_name[, reason='Non given.']) | +Moves a player to jail and removes all other roles | +
| unjail_player (player, by_player_name) | +Moves a player out of jail and restores all roles previously removed | +
| is_temp_banned (player) | +Checks if a player is temp banned | +
| temp_ban_player (player, by_player_name[, reason='Non given.']) | +Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn | +
| untemp_ban_player (player, by_player_name) | +Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles | +
When a player is assigned to jail
+ + + + Event Parameters: + +When a player is temp banned
+ + + + Event Parameters: + +When a player is unassigned from jail
+ + + + Event Parameters: + +When a temp ban is removed from a player
+ + + + Event Parameters: + +Checks if the player is currently in jail
+ + + + Parameters: + +Moves a player to jail and removes all other roles
+ + + + Parameters: + +Moves a player out of jail and restores all roles previously removed
+ + + + Parameters: + +Checks if a player is temp banned
+ + + + Parameters: + +Temp bans a player by moving them to jail, clearing all other roles, storing the reason, and moving their items to spawn
+ + + + Parameters: + +Rrmoves a player from temp ban by clearing the stored reason, removing them from jail, and restoring previous roles
+ + + + Parameters: + +