Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------Scan-----------------------------------------
- ulx.itemnames = {
- "resupply",
- "turret",
- "arsenal",
- "refab",
- "medkit",
- }
- function ulx.scanall( calling_ply, item )
- local itemtable = {
- ["resupply"] = "prop_resupplybox",
- ["turret"] = "prop_gunturret",
- ["arsenal"] = "prop_arsenalcrate",
- ["refab"] = "prop_refabricator",
- ["banishedcrate"] = "prop_banishedcrate"
- }
- local weapontable = {
- ["resupply"] = "weapon_zs_resupplybox",
- ["turret"] = "weapon_zs_gunturret",
- ["arsenal"] = "weapon_zs_arsenalcrate",
- ["refab"] = "weapon_zs_refabricator",
- ["medkit"] = "weapon_zs_medicalkit",
- ["banishedcrate"] = "weapon_zs_banishedcrate"
- }
- local itemconv = itemtable[item]
- local wepconv = weapontable[item]
- if not item then
- ULib.tsay(calling_ply, "You must specify an item to scan for.")
- else
- local found = false
- if wepconv then
- for k,v in pairs(team.GetPlayers(TEAM_HUMAN)) do
- if v:HasWeapon(wepconv) then
- ULib.tsay(calling_ply, v:Nick() .. " has the item: " .. item)
- found = true
- end
- end
- for k,v in pairs(ents.FindByClass("prop_weapon")) do
- if v:GetWeaponType() == wepconv then
- ULib.tsay(calling_ply, "A dropped weapon of type " .. item .. " exists." )
- found = true
- end
- end
- end
- if itemconv then
- for k,v in pairs(ents.FindByClass(itemconv)) do
- local owner = v:GetObjectOwner()
- if IsValid(owner) and owner:IsPlayer() and owner:Team() != TEAM_UNDEAD then
- ULib.tsay(calling_ply, owner:Nick() .. " has the item: " .. item .. " (Deployed)")
- found = true
- else
- ULib.tsay(calling_ply, "A deployed " .. item .. " exists, but its owner is dead.")
- found = true
- end
- end
- end
- if not found then
- ULib.tsay(calling_ply, "Nobody has the item: " .. item)
- end
- end
- end
- local scanall = ulx.command( CATEGORY_NAME, "ulx scanall", ulx.scanall, "!scanall" )
- scanall:addParam{ type=ULib.cmds.StringArg, completes=ulx.itemnames, hint="item", error="invalid class", ULib.cmds.restrictToCompletes, ULib.cmds.takeRestOfLine }
- scanall:defaultAccess( ULib.ACCESS_ADMIN )
- scanall:help( "Scan for a weapon." )
- -------Remove Nails---------
- function ulx.remnails(calling_ply, target_plys)
- local affected_plys = {}
- for i=1, #target_plys do
- local v = target_plys[ i ]
- for _, k in pairs(ents.GetAll()) do
- if k:GetClass() == "prop_nail" and player.GetByUniqueID(k:GetOwnerUID()) == v then
- k:GetParent():RemoveNail(k, nil, v)
- end
- end
- table.insert( affected_plys, v )
- end
- ulx.fancyLogAdmin( calling_ply, "#A removed the nails of #T.", affected_plys )
- end
- local remnails = ulx.command( CATEGORY_NAME, "ulx remnails", ulx.remnails, "!remnails")
- remnails:defaultAccess( ULib.ACCESS_ADMIN )
- remnails:addParam{ type=ULib.cmds.PlayersArg }
- remnails:help("Removes a player's nails.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement