Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CATEGORY_NAME = "Kitsu ULX"
- local doJail
- local jailableArea
- function ulx.jailstrip ( calling_ply, target_ply, seconds, should_unjail )
- local affected_plys = {}
- for i=1, #target_plys do
- local v = target_plys[ i ]
- if not should_unjail then
- if ulx.getExclusive( v, calling_ply ) then
- ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
- elseif not jailableArea( v:GetPos() ) then
- ULib.tsayError( calling_ply, v:Nick() .. " is not in an area where a jail can be placed!", true )
- else
- doJail( v, seconds )
- table.insert( affected_plys, v )
- end
- elseif v.jail then
- v.jail.unjail()
- v.jail = nil
- table.insert( affected_plys, v )
- end
- end
- if not should_unjail then
- local str = "#A jailed #T"
- if seconds > 0 then
- str = str .. " for #i seconds"
- end
- ulx.fancyLogAdmin( calling_ply, str, affected_plys, seconds )
- else
- ulx.fancyLogAdmin( calling_ply, "#A unjailed #T", affected_plys )
- end
- end
- local jail = ulx.command( CATEGORY_NAME, "ulx jailstrip", ulx.jailstrip, "!jailstrip" )
- jail:addParam{ type=ULib.cmds.PlayersArg }
- jail:addParam{ type=ULib.cmds.NumArg, min=0, default=0, hint="seconds, 0 is forever", ULib.cmds.round, ULib.cmds.optional }
- jail:addParam{ type=ULib.cmds.BoolArg, invisible=true }
- jail:defaultAccess( ULib.ACCESS_ADMIN )
- jail:help( "Jails target(s)." )
- jail:setOpposite( "ulx unjailstrip", {_, _, _, true}, "!unjailstrip" )
- for i=1, #target_plys do
- target_plys[ i ]:StripWeapons()
- end
- ulx.fancyLogAdmin( calling_ply, "#A stripped weapons from #T", target_plys )
- end
- local strip = ulx.command( CATEGORY_NAME, "ulx strip", ulx.stripweapons, "!strip" )
- strip:addParam{ type=ULib.cmds.PlayersArg }
- strip:defaultAccess( ULib.ACCESS_ADMIN )
- strip:help( "Strip weapons from target(s)." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement