Hey! So what me and my community are trying to do is edit the jail command (from the command below) to not set you in a box like it usually does, but to send you to a jail ROOM. So that we can assign maybe a vector to it so whenever you jail them, it will send you to the room until your time runs out. thanks!
-- Jail a player.
--
local command = {};
command.help = "Jail a player.";
command.command = "jail";
command.arguments = {"player", "seconds"};
command.permissions = "Jail";
command.immunity = SERVERGUARD.IMMUNITY.LESSOREQUAL;
function command:OnPlayerExecute(player, target, arguments)
if (!target.sg_jail) then
local duration = tonumber(arguments[2]) or 0;
serverguard:JailPlayer(target, duration);
return true;
end;
end;
function command:OnNotify(player, targets)
return SGPF("command_jail", serverguard.player:GetName(player), util.GetNotifyListForTargets(targets), (targets[1].sg_jailTime and targets[1].sg_jailTime .. " second(s)") or "Indefinite");
end;
function command:ContextMenu(player, menu, rankData)
local jailMenu, menuOption = menu:AddSubMenu("Jail");
menuOption:SetImage("icon16/lock.png");
for k, v in pairs(serverguard.jailLengths) do
local option = jailMenu:AddOption(v[1], function()
serverguard.command.Run("jail", false, player:Name(), v[2]);
end);
option:SetImage("icon16/clock.png");
end;
local option = jailMenu:AddOption("Custom", function()
Derma_StringRequest("Jail Length", "Specify jail time in seconds.", "", function(duration)
serverguard.command.Run("jail", false, player:Name(), tonumber(duration));
end, function(text) end, "Accept", "Cancel");
end);
option:SetImage("icon16/clock.png");
end;
serverguard.command:Add(command);
The command runs the "serverguard:JailPlayer" function
Find that function and edit it to where it doesnt spawn the jail props and instead sets the players position using Entity/SetPos and re-spawns them back at their spawn when the timer runs out
So, along the lines of changing t his?
serverguard:JailPlayer(target, duration);
edit the function code and replace the prop spawning/removing with setpos/returning the player.
Sorry, you need to Log In to post a reply to this thread.