function ur.modifyLoadout( ply, command, args) if ply:IsAdmin() then if ur.loadouts[args[1] ]["loadout"] then for k,v in ipairs( args ) do if k ~= 1 then if not (table.HasValue(ur.loadouts[args[1] ]["loadout"], v)) then table.insert(ur.loadouts[args[1] ]["loadout"], v) ULib.tsay(ply, "Successfully Added: " ..v.. " to " ..args[1]) else for k2,v2 in pairs(ur.loadouts[args[1] ]["loadout"]) do if v2 == v then table.remove(ur.loadouts[args[1] ]["loadout"], k2) ULib.tsay(ply, "Successfully Removed: " ..v.. " from " ..args[1]) end end end end end ur.updateTables() ur.syncClient() end else ULib.tsay(ply, "You Don't Have Access To This Command") end end --ULib.add_subconcommand( "urestrict", "modify", ur.modifyLoadout ) function ur.makeLoadout( ply, command, args ) if ply:IsAdmin() then if not(ur.loadouts[args[1] ]) then ur.loadouts[args[1] ] = { ["loadout"] = {}, ["groups"] = {} } ur.updateTables() ur.syncClient() ULib.tsay(ply, args[1].. " Successfully Created") else ULib.tsay(ply, args[1].. " Already Exists") end else ULib.tsay(ply, "You Don't Have Access To This Command") end end --ULib.add_subconcommand( "urestrict", "make", ur.makeLoadout ) function ur.removeLoadout( ply, command, args ) if ply:IsAdmin() then if ur.loadouts[args[1] ] and args[1] ~= "excluded" then ur.loadouts[args[1] ] = nil ur.updateTables() ur.syncClient() ULib.clientRPC( ply, "ur.removeLoadout", args[1] ) ULib.tsay(ply, args[1].. " Successfully Removed") else ULib.tsay(ply, args[1].. " Doesn't Exist") end else ULib.tsay(ply, "You Don't Have Access To This Command") end end --ULib.add_subconcommand( "urestrict", "remove", ur.removeLoadout ) function ur.applyLoadout( ply, command, args ) if ply:IsAdmin() then if ULib.ucl.groups[args[1] ] then if ur.loadouts[args[2] ] then ur.clearLoadout( args[1] ) if args[2] == "excluded" then table.insert(ur.loadouts.excluded, args[1] ) ULib.tsay( ply, args[1].. " Successfully Excluded") else table.insert(ur.loadouts[args[2] ]["groups"], args[1]) ULib.tsay( ply, "Successfully Applied " ..args[1].. " to " ..args[2]) end else ULib.tsay(ply, "Invalid Loadout Entered") end else ULib.tsay(ply, "Invalid Group Entered") end ur.updateTables() ur.syncClient() else ULib.tsay(ply, "You Don't Have Access To This Command") end end --ULib.add_subconcommand( "urestrict", "apply", ur.applyLoadout ) function ur.excludeGroup( ply, command, args ) if ply:IsAdmin() then if ur.loadouts.excluded then if not(table.HasValue(ur.loadouts.excluded, args[1])) then ur.clearLoadout( args[1] ) table.insert(ur.loadouts.excluded, args[1] ) ULib.tsay( ply, args[1].. " Successfully Excluded") end else ur.loadouts["excluded"] = { } ur.excludeGroup( args[1] ) end ur.updateTables() ur.syncClient() else ULib.tsay(ply, "You Don't Have Access To This Command") end end --ULib.add_subconcommand( "urestrict", "exclude", ur.excludeGroup ) function ur.modifyTool( ply, command, args ) if ply:IsAdmin() then if args[1] then if table.HasValue(ur.tools.list, args[1]) then if not(ur.tools[args[1] ]) then ur.tools[args[1] ] = {} ur.updateTables() ur.syncClient() ULib.tsay(ply, "Restriction Applied To: " ..args[1]) else if (ur.tools[args[1] ]) then ur.tools[args[1] ] = nil ur.updateTables() ur.syncClient() ULib.tsay(ply, "Restrictions Have Been Lifted From: " ..args[1]) end end else ULib.tsay(ply, "Invalid Tool") end else ULib.tsay(ply, "Please Specify A Tool") end else ULib.tsay(ply, "You Don't Have Access To That Command") end end --ULib.add_subconcommand( "urestrict", "tool", ur.modifyTool ) function ur.toolAllow( ply, command, args ) if ply:IsAdmin() then if args[1] then if args[2] then if ULib.ucl.groups[args[1] ] then if ur.tools[args[2] ] then if not(table.HasValue(ur.tools[args[2] ], args[1])) then if args[2] == "excluded" then ur.clearTools(args[1]) table.insert(ur.tools[args[2] ], args[1]) ur.updateTables() ur.syncClient() ULib.tsay(ply, args[1].. "s Are Now Allowed To Use " ..args[2]) else table.insert(ur.tools[args[2] ], args[1]) ur.updateTables() ur.syncClient() ULib.tsay(ply, args[1].. "s Are Now Allowed To Use " ..args[2]) end else ULib.tsay(ply, "User Group Is Already Allowed To Use That Tool") end else ULib.tsay(ply, "Please Apply Restrictions To The Tool First") end else ULib.tsay(ply, "Invalid Group") end else Ulib.tsay(ply, "Please Specify A Tool") end else ULib.tsay(ply, "Please Specify A Group") end else ULib.tsay(ply, "You Don't Have Access To That Command!") end end --ULib.add_subconcommand( "urestrict", "allow", ur.toolAllow ) function ur.toolDeny( ply, command, args ) if ply:IsAdmin() then if args[1] then if args[2] then if ULib.ucl.groups[args[1] ] then if ur.tools[args[2] ] then for k,v in pairs(ur.tools[args[2] ]) do if args[1] == v then table.remove(ur.tools[args[2] ], k) ur.updateTables() ur.syncClient() ULib.tsay(ply, args[1].. "s Are No Longer Allowed To Use " ..args[2]) end end end else ULib.tsay(ply, "Invalid Group") end else Ulib.tsay(ply, "Please Specify A Tool") end else ULib.tsay(ply, "Please Specify A Group") end else ULib.tsay(ply, "You Don't Have Access To That Command!") end end --ULib.add_subconcommand( "urestrict", "deny", ur.toolDeny ) function ur.groupExclude( ply, commands, args ) if ply:IsAdmin() then if args[1] then if ULib.ucl.groups[args[1] ] then if not(table.HasValue(ur.tools["excluded"], args[1])) then ur.clearTools(args[1]) table.insert(ur.tools["excluded"], args[1]) ur.updateTables() ur.syncClient() ULib.tsay(ply, args[1].. "s Are No Longer Under Tool Restrictions") else ULib.tsay(ply, "Group Is Already Excluded") end else ULib.tsay(ply, "Invalid Group") end else ULib.tsay(ply, "Please Specify a group") end else ULib.tsay(ply, "You Don't Have Access To That Command") end end --ULib.add_subconcommand( "urestrict", "toolexclude", ur.groupExclude ) function ur.prop( group, limit ) if type( tonumber(limit) ) == "number" then ur.limit.props[ group ] = limit ur.updateTables() ur.syncClient() else ULib.tsay(ply, "Please Enter In A Valid Number") end end function ur.npc( group, limit ) if type( tonumber(limit) ) == "number" then ur.limit.npcs[ group ] = limit ur.updateTables() ur.syncClient() else ULib.tsay(ply, "Please Enter In A Valid Number") end end function ur.vehicle( group, limit ) if type( tonumber(limit) ) == "number" then ur.limit.vehicles[ group ] = limit ur.updateTables() ur.syncClient() else ULib.tsay(ply, "Please Enter In A Valid Number") end end function ur.ragdoll( group, limit ) if type( tonumber(limit) ) == "number" then ur.limit.ragdolls[ group ] = limit ur.updateTables() ur.syncClient() else ULib.tsay(ply, "Please Enter In A Valid Number") end end function ur.sent( group, limit ) if type( tonumber(limit) ) == "number" then ur.limit.sents[ group ] = limit ur.updateTables() ur.syncClient() else ULib.tsay(ply, "Please Enter In A Valid Number") end end function ur.dspawns( group, type, name ) if !ur.spawn[type][group] then ur.spawn[type][group] = {} end if !table.HasValue(ur.spawn[type][group], name) then table.insert(ur.spawn[type][group], name) ur.updateTables() ur.syncClient() else ULib.tsay(ply, name.. " is already restrict to " .. group) end end function ur.aspawns( group, type, name ) if !ur.spawn[type][group] then ur.spawn[type][group] = {} end if table.HasValue(ur.spawn[type][group], name) then for k, v in pairs(ur.spawn[type][group]) do if string.find(v, name) then table.remove(ur.spawn[type][group], k) end end ur.updateTables() ur.syncClient() else ULib.tsay(ply, group.. " is already allowed to spawn " .. name) end end