Nayruden/Ulysses — pull request #332 by LuaTenshi (2014-08-05 20:13:09+00:00)
Title: Added a hook for custom pieces

![05_16-10-32](https://cloud.githubusercontent.com/assets/3096584/3817931/cb8d3f2e-1cdc-11e4-9799-0c311e4dfa62.png)

Added a hook to allow custom pieces within ULib.getUsers. Lines: 219 - 223

Here is a quick example...

hook.Add("ulx_custompiece", "__j", function(ply, p)
if p:sub( 1, 1 ) == "&" then
local uSel = ply._ulxSelection
if uSel and type(uSel) == "table" and #uSel >= 1 then
local tab = {}
for _,v in next, ply._ulxSelection do
if IsValid(v) and v:IsPlayer() then
table.insert(tab, v)
end
end
return tab
else
return nil
end
end
end)