Fix for "all" restrictions...

* Fixed "all" restrictions not being checked if a regular restriction existed at all

Example:
Restricted from all sweps
Admins restricted from weapon_pistol
URS will see the weapon_pistol restriction and not check the "all"
This commit is contained in:
Aaron 2015-04-02 16:29:14 -05:00
parent 6e82699ead
commit f1ecaf5eb0

View File

@ -66,11 +66,11 @@ function URS.Check(ply, type, what)
URS.PrintRestricted(ply, type, what) URS.PrintRestricted(ply, type, what)
return false return false
end end
end
elseif URS.restrictions["all"] and URS.restrictions["all"][type] and table.HasValue(URS.restrictions["all"][type], group) then
if URS.restrictions["all"] and URS.restrictions["all"][type] and table.HasValue(URS.restrictions["all"][type], group) then
ULib.tsayError(ply, "Your rank is restricted from all ".. type .."s") ULib.tsayError(ply, "Your rank is restricted from all ".. type .."s")
return false return false
elseif table.HasValue(URS.types.limits, type) and URS.limits[type] and (URS.limits[type][ply:SteamID()] or URS.limits[type][group]) then elseif table.HasValue(URS.types.limits, type) and URS.limits[type] and (URS.limits[type][ply:SteamID()] or URS.limits[type][group]) then
if URS.limits[type][ply:SteamID()] then if URS.limits[type][ply:SteamID()] then
if ply:GetCount(type.."s") >= URS.limits[type][ply:SteamID()] then if ply:GetCount(type.."s") >= URS.limits[type][ply:SteamID()] then