What do you mean by "Security Positions"? Assuming this is for DarkRP, would it be all jobs with the arrest stick?
This may work however I've not tested it and it probably has an error or two. I tried to make the code easy to read so if there are any errors you should be able to fix them with little effort.
function ulx.bansecjob( calling_ply, target_plys, unban )
for k,ply in pairs( target_plys ) do
if IsValid(ply) and ply.teamBan and ply.teamUnBan then
for _,v in pairs( RPExtraTeams ) do
local loadout = v.PlayerLoadout
local TEAM = v.team
if ( TEAM and loadout and next(loadout) ) and ( table.HasValue( loadout, "arrest_stick" ) ) then
if unban then
ply:teamUnBan( TEAM )
else
ply:teamBan( TEAM, 0 )
end
end
end
else
local plyname = ply.Nick and "`" .. ply:Nick() .. "`" or "An unkown player"
ULib.tsayError( calling_ply, plyname .. " can not be job banned currently.", true )
table.remove(target_plys, k)
end
end
if not next(target_plys) then
ULib.tsayError( calling_ply, "The specified target or targets can not be job banned at this time.", true )
return
end
if unban then
ulx.fancyLogAdmin( calling_ply, "#A unbanned #T from all security jobs", target_plys )
else
ulx.fancyLogAdmin( calling_ply, "#A banned #T from all security jobs", target_plys )
end
end
local bansecjob = ulx.command( "Utility", "ulx bsj", ulx.bansecjob, "!bsj" )
bansecjob:addParam{ type=ULib.cmds.PlayersArg }
bansecjob:defaultAccess( ULib.ACCESS_SUPERADMIN )
bansecjob:help( "Ban players from all security jobs. (Current session only)" )
bansecjob:setOpposite( "ulx unbsj", {_, _, true}, "!unbsj")
The commands for it are "!bsj james", "ulx bsj james" in console, and "!unbsj james", "ulx unbsj james" in console. ("james" is just an example name you can obviously target people who aren't named james.)
By default the command is superadmin and up, however you can change its perms. Find it under the "Utility" section of your XGUI.