Advertisement
Guest User

Untitled

a guest
Apr 18th, 2020
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. -------------Scan-----------------------------------------
  2. ulx.itemnames = {
  3. "resupply",
  4. "turret",
  5. "arsenal",
  6. "refab",
  7. "medkit",
  8. }
  9.  
  10. function ulx.scanall( calling_ply, item )
  11.  
  12. local itemtable = {
  13. ["resupply"] = "prop_resupplybox",
  14. ["turret"] = "prop_gunturret",
  15. ["arsenal"] = "prop_arsenalcrate",
  16. ["refab"] = "prop_refabricator",
  17. ["banishedcrate"] = "prop_banishedcrate"
  18. }
  19.  
  20. local weapontable = {
  21. ["resupply"] = "weapon_zs_resupplybox",
  22. ["turret"] = "weapon_zs_gunturret",
  23. ["arsenal"] = "weapon_zs_arsenalcrate",
  24. ["refab"] = "weapon_zs_refabricator",
  25. ["medkit"] = "weapon_zs_medicalkit",
  26. ["banishedcrate"] = "weapon_zs_banishedcrate"
  27. }
  28.  
  29. local itemconv = itemtable[item]
  30. local wepconv = weapontable[item]
  31.  
  32. if not item then
  33. ULib.tsay(calling_ply, "You must specify an item to scan for.")
  34. else
  35. local found = false
  36. if wepconv then
  37. for k,v in pairs(team.GetPlayers(TEAM_HUMAN)) do
  38. if v:HasWeapon(wepconv) then
  39. ULib.tsay(calling_ply, v:Nick() .. " has the item: " .. item)
  40. found = true
  41. end
  42. end
  43. for k,v in pairs(ents.FindByClass("prop_weapon")) do
  44. if v:GetWeaponType() == wepconv then
  45. ULib.tsay(calling_ply, "A dropped weapon of type " .. item .. " exists." )
  46. found = true
  47. end
  48. end
  49. end
  50. if itemconv then
  51. for k,v in pairs(ents.FindByClass(itemconv)) do
  52. local owner = v:GetObjectOwner()
  53. if IsValid(owner) and owner:IsPlayer() and owner:Team() != TEAM_UNDEAD then
  54. ULib.tsay(calling_ply, owner:Nick() .. " has the item: " .. item .. " (Deployed)")
  55. found = true
  56. else
  57. ULib.tsay(calling_ply, "A deployed " .. item .. " exists, but its owner is dead.")
  58. found = true
  59. end
  60. end
  61. end
  62. if not found then
  63. ULib.tsay(calling_ply, "Nobody has the item: " .. item)
  64. end
  65. end
  66. end
  67.  
  68. local scanall = ulx.command( CATEGORY_NAME, "ulx scanall", ulx.scanall, "!scanall" )
  69. scanall:addParam{ type=ULib.cmds.StringArg, completes=ulx.itemnames, hint="item", error="invalid class", ULib.cmds.restrictToCompletes, ULib.cmds.takeRestOfLine }
  70. scanall:defaultAccess( ULib.ACCESS_ADMIN )
  71. scanall:help( "Scan for a weapon." )
  72.  
  73. -------Remove Nails---------
  74. function ulx.remnails(calling_ply, target_plys)
  75. local affected_plys = {}
  76.  
  77. for i=1, #target_plys do
  78. local v = target_plys[ i ]
  79. for _, k in pairs(ents.GetAll()) do
  80. if k:GetClass() == "prop_nail" and player.GetByUniqueID(k:GetOwnerUID()) == v then
  81. k:GetParent():RemoveNail(k, nil, v)
  82. end
  83. end
  84. table.insert( affected_plys, v )
  85. end
  86.  
  87. ulx.fancyLogAdmin( calling_ply, "#A removed the nails of #T.", affected_plys )
  88.  
  89. end
  90. local remnails = ulx.command( CATEGORY_NAME, "ulx remnails", ulx.remnails, "!remnails")
  91. remnails:defaultAccess( ULib.ACCESS_ADMIN )
  92. remnails:addParam{ type=ULib.cmds.PlayersArg }
  93. remnails:help("Removes a player's nails.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement