New ULX command that teleports, jails, and freezes the target
6 replies, posted
I know this code is probably wrong and I don't know enough to get it woorking 100%, but this is kinda what I would like to look like. If any can help that would be amazing!
Thanks so much!
[CODE]
function ulx.jailftp( calling_ply, target_ply, should_unfreeze,)
local t = {}
t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
t.filter = target_ply
if target_ply ~= calling_ply then
t.filter = { target_ply, calling_ply }
end
local tr = util.TraceEntity( t, target_ply )
local pos = tr.HitPos
if not should_unfreeze then
target_ply:Lock()
target_ply.frozen = true
ulx.setExclusive( v, "frozen" )
else
Target_ply:UnLock()
Target_ply.frozen = nil
ulx.clearExclusive( v )
end
if target_ply.whipped then
target_ply.whipcount = target_ply.whipamt -- Will make it remove
end
if ulx.getExclusive( target_ply, calling_ply ) then
ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
return
elseif not target_ply:Alive() then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
return
elseif not jailableArea( pos ) then
ULib.tsayError( calling_ply, "That is not an area where a jail can be placed!", true )
return
else
if target_ply:InVehicle() then
target_ply:ExitVehicle()
end
target_ply:SetPos( pos )
target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
doJail( target_ply )
end
local str = "#A teleported, froze and jailed #T"
end
ulx.fancyLogAdmin( calling_ply, str, target_ply, seconds )
end
local jailftp = ulx.command( CATEGORY_NAME, "ulx jailftp", ulx.jailftp, "!jailftp" )
jailftp:addParam{ type=ULib.cmds.PlayerArg }
jailftp:addParam{ type=ULib.cmds.NumArg, min=0, default=0, hint="seconds, 0 is forever", ULib.cmds.round, ULib.cmds.optional }
jailftp:defaultAccess( ULib.ACCESS_ADMIN )
jailftp:help( "Teleports, freezes then jails target(s)." )
[/CODE]
Isn't freezing redundant when you jail? I know you can't target people when they're frozen, and that includes jailing them, and vice versa. (at least with ULX)
If you are frozen you can't kill yourself. Then again, you respawn in jail.
[QUOTE=meharryp;44665464]If you are frozen you can't kill yourself. Then again, you respawn in jail.[/QUOTE]
Then isn't jailing someone who's frozen redundant?
Isn't there already a jailtp command? And why would you need to freeze them in the jail? They're already stuck there. Freezing them would mean you couldn't kill them and what's the fun in that?
Okay, here is the problem. If you can find a better work around that would be great. I jailtp someone, then they get a rocket launcher out and start shooting it. That's fine I just strip them, but then they just die and can get weapons back again. So if someone could fix jailtp to prevent this. That would be amazing. Thanks
Jail/TP/Freeze is a good way to do it. Mind you, if someone is being that much of a pain in the ass I just give them a ban without the usual lecture.
Sorry, you need to Log In to post a reply to this thread.