Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. local CATEGORY_NAME = "Kitsu ULX"
  2.  
  3. local doJail
  4. local jailableArea
  5. function ulx.jailstrip ( calling_ply, target_ply, seconds, should_unjail )
  6.  
  7. local affected_plys = {}
  8. for i=1, #target_plys do
  9. local v = target_plys[ i ]
  10.  
  11. if not should_unjail then
  12. if ulx.getExclusive( v, calling_ply ) then
  13. ULib.tsayError( calling_ply, ulx.getExclusive( v, calling_ply ), true )
  14. elseif not jailableArea( v:GetPos() ) then
  15. ULib.tsayError( calling_ply, v:Nick() .. " is not in an area where a jail can be placed!", true )
  16. else
  17. doJail( v, seconds )
  18.  
  19. table.insert( affected_plys, v )
  20. end
  21. elseif v.jail then
  22. v.jail.unjail()
  23. v.jail = nil
  24. table.insert( affected_plys, v )
  25. end
  26. end
  27.  
  28. if not should_unjail then
  29. local str = "#A jailed #T"
  30. if seconds > 0 then
  31. str = str .. " for #i seconds"
  32. end
  33. ulx.fancyLogAdmin( calling_ply, str, affected_plys, seconds )
  34. else
  35. ulx.fancyLogAdmin( calling_ply, "#A unjailed #T", affected_plys )
  36. end
  37. end
  38. local jail = ulx.command( CATEGORY_NAME, "ulx jailstrip", ulx.jailstrip, "!jailstrip" )
  39. jail:addParam{ type=ULib.cmds.PlayersArg }
  40. jail:addParam{ type=ULib.cmds.NumArg, min=0, default=0, hint="seconds, 0 is forever", ULib.cmds.round, ULib.cmds.optional }
  41. jail:addParam{ type=ULib.cmds.BoolArg, invisible=true }
  42. jail:defaultAccess( ULib.ACCESS_ADMIN )
  43. jail:help( "Jails target(s)." )
  44. jail:setOpposite( "ulx unjailstrip", {_, _, _, true}, "!unjailstrip" )
  45. for i=1, #target_plys do
  46. target_plys[ i ]:StripWeapons()
  47. end
  48.  
  49. ulx.fancyLogAdmin( calling_ply, "#A stripped weapons from #T", target_plys )
  50. end
  51. local strip = ulx.command( CATEGORY_NAME, "ulx strip", ulx.stripweapons, "!strip" )
  52. strip:addParam{ type=ULib.cmds.PlayersArg }
  53. strip:defaultAccess( ULib.ACCESS_ADMIN )
  54. strip:help( "Strip weapons from target(s)." )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement