Added limit cfg and fixed previous

+ Added ulx_urs_overwrite_sbox (overwrite sbox limits)
 * Fixed previous cfgs that weren't handled properly
This commit is contained in:
Aaron 2015-03-11 10:41:12 -05:00
parent cccc8b6b17
commit adc901a4c5
2 changed files with 7 additions and 7 deletions

View File

@ -9,14 +9,12 @@ URS.limits = {}
URS.loadouts = {}
URS.cfg = {}
URS.cfg.weaponPickups = 0
URS.cfg.echoSpawns = 0
URS.cfg.echoCommands = 0
if SERVER then
URS.cfg.weaponPickups = ulx.convar("urs_weaponpickups", 2)
URS.cfg.echoSpawns = ulx.convar("urs_echo_spawns", 1)
URS.cfg.echoCommands = ulx.convar("urs_echo_commands", 1)
URS.cfg.overwriteSbox = ulx.convar("urs_overwrite_sbox", 1)
URS.Load()
end

View File

@ -31,7 +31,7 @@ end
function URS.PrintRestricted(ply, type, what)
if type == "pickup" then return end -- Constant spam
if URS.cfg.echoSpawns then
if URS.cfg.echoSpawns:GetBool() then
ulx.logSpawn(ply:Nick() .."<".. ply:SteamID() .."> spawned/used ".. type .." ".. what .." -=RESTRICTED=-")
end
ULib.tsayError(ply, "\"".. what .."\" is a restricted ".. type .." from your rank.")
@ -69,7 +69,9 @@ function URS.Check(ply, type, what)
return false
end
end
return true -- Overwrite sbox limit (ours is greater)
if URS.cfg.overwriteSbox:GetBool() then
return true -- Overwrite sbox limit (ours is greater)
end
end
end
@ -109,7 +111,7 @@ hook.Add( "PlayerSpawnProp", "URSCheckRestrictedProp", URS.CheckRestrictedProp,
function URS.CheckRestrictedTool(ply, tr, tool)
if URS.Check( ply, "tool", tool ) == false then return false end
if URS.cfg.echoSpawns and tool != "inflator" then
if URS.cfg.echoSpawns:GetBool() and tool != "inflator" then
ulx.logSpawn( ply:Nick().."<".. ply:SteamID() .."> used the tool ".. tool .." on ".. tr.Entity:GetModel() )
end
end
@ -132,7 +134,7 @@ hook.Add( "PlayerSpawnRagdoll", "URSCheckRestrictedRagdoll", URS.CheckRestricted
function URS.CheckRestrictedSWEP(ply, class, weapon)
if URS.Check( ply, "swep", class ) == false then return false end
if URS.cfg.echoSpawns then
if URS.cfg.echoSpawns:GetBool() then
ulx.logSpawn( ply:Nick().."<".. ply:SteamID() .."> spawned/gave himself swep ".. class )
end
end