Skip to content

Commit

Permalink
Implement weapon disable convars
Browse files Browse the repository at this point in the history
...and encompass weapon scripts in according if statements. This WILL NOT WORK RIGHT NOW. I need to format the if statements with proper indentation. This will be done in a sweeping reformating of all code in the repo (spaces to tabs, remove whitespace between parentheses).
  • Loading branch information
Fuzzik committed May 21, 2019
1 parent adc734c commit b784f74
Show file tree
Hide file tree
Showing 20 changed files with 134 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/entities/ttt_frag_proj.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_frag == "0" ) then -- Disable convar start

AddCSLuaFile()

ENT.Type = "anim"
Expand Down Expand Up @@ -56,3 +60,5 @@ function ENT:Explode( tr )
self:SetDetonateExact( 0 )
end
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_ak47.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_ak47 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -46,3 +50,5 @@ if CLIENT then
desc = "Assault rifle with very high damage.\n\nHas very high recoil."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_aug.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_aug == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -143,3 +147,5 @@ if CLIENT then
return ( self:GetIronsights() and 0.2 ) or nil
end
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_awp.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_awp == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -152,3 +156,5 @@ if CLIENT then
desc = "Silenced AWP Sniper Rifle.\n\nOnly has two shots.\n\nVictims will not scream when killed."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_famas.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_famas == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -36,3 +40,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_frag.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_frag == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -34,3 +38,5 @@ if CLIENT then
desc = "A highly explosive grenade."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_g3sg1.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_g3sg1 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -144,3 +148,5 @@ if CLIENT then
return ( self:GetIronsights() and 0.2 ) or nil
end
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_galil.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_galil == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -36,3 +40,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_jihad.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_jihad == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -78,3 +82,5 @@ if CLIENT then
desc = "Sacrifice yourself to Allah.\n\nYour 72 virgins await."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_m4a1_s.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_m4a1_s == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -46,3 +50,5 @@ if CLIENT then
desc = "A modified M4A1 carbine with a suppressor.\n\nVictims will not scream when killed."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_mp5.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_mp5 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -37,3 +41,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_p228.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_p228 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -36,3 +40,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_p90.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_p90 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -152,3 +156,5 @@ if CLIENT then
desc = "Extremely fast firing SMG.\n\nComes with a mounted scope."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_pistol.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_usp == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -37,3 +41,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_pump.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_pump == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -169,3 +173,5 @@ function SWEP:SecondaryAttack()

self:SetNextSecondaryFire( CurTime() + 0.3 )
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_revolver.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_revolver == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -57,3 +61,5 @@ if CLIENT then
desc = "Eliminate any terrorist in one shot."
}
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_sg552.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_sg552 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -143,3 +147,5 @@ if CLIENT then
return ( self:GetIronsights() and 0.2 ) or nil
end
end

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_smg.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_mp7 == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -36,3 +40,5 @@ SWEP.InLoadoutFor = { nil }
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = false

end -- Disable convar end
6 changes: 6 additions & 0 deletions gamemodes/terrortown/entities/weapons/weapon_ttt_tmp_s.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
include( "autorun/server/create_convars.lua" )

if ( fuzzik_disable_tmp_s == "0" ) then -- Disable convar start

AddCSLuaFile()

if CLIENT then
Expand Down Expand Up @@ -46,3 +50,5 @@ if CLIENT then
desc = "Low-noise SMG that uses normal 9mm ammo.\n\nVictims will not scream when killed."
}
end

end -- Disable convar end
20 changes: 20 additions & 0 deletions lua/autorun/server/create_convars.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- This file creates convars to allow disabling weapons.

local fuzzik_disable_ak47 = CreateConVar( "fuzzik_disable_ak47", "0", FCVAR_ARCHIVE )
local fuzzik_disable_aug = CreateConVar( "fuzzik_disable_aug", "0", FCVAR_ARCHIVE )
local fuzzik_disable_awp = CreateConVar( "fuzzik_disable_awp", "0", FCVAR_ARCHIVE )
local fuzzik_disable_famas = CreateConVar( "fuzzik_disable_famas", "0", FCVAR_ARCHIVE )
local fuzzik_disable_frag = CreateConVar( "fuzzik_disable_frag", "0", FCVAR_ARCHIVE )
local fuzzik_disable_g3sg1 = CreateConVar( "fuzzik_disable_g3sg1", "0", FCVAR_ARCHIVE )
local fuzzik_disable_galil = CreateConVar( "fuzzik_disable_galil", "0", FCVAR_ARCHIVE )
local fuzzik_disable_jihad = CreateConVar( "fuzzik_disable_jihad", "0", FCVAR_ARCHIVE )
local fuzzik_disable_m4a1_s = CreateConVar( "fuzzik_disable_m4a1_s", "0", FCVAR_ARCHIVE )
local fuzzik_disable_mp5 = CreateConVar( "fuzzik_disable_mp5", "0", FCVAR_ARCHIVE )
local fuzzik_disable_p90 = CreateConVar( "fuzzik_disable_p90", "0", FCVAR_ARCHIVE )
local fuzzik_disable_p228 = CreateConVar( "fuzzik_disable_p228", "0", FCVAR_ARCHIVE )
local fuzzik_disable_usp = CreateConVar( "fuzzik_disable_usp", "0", FCVAR_ARCHIVE ) -- weapon_ttt_pistol
local fuzzik_disable_pump = CreateConVar( "fuzzik_disable_pump", "0", FCVAR_ARCHIVE )
local fuzzik_disable_revolver = CreateConVar( "fuzzik_disable_revolver", "0", FCVAR_ARCHIVE )
local fuzzik_disable_sg552 = CreateConVar( "fuzzik_disable_sg552", "0", FCVAR_ARCHIVE )
local fuzzik_disable_mp7 = CreateConVar( "fuzzik_disable_mp7", "0", FCVAR_ARCHIVE ) -- weapon_ttt_smg
local fuzzik_disable_tmp_s = CreateConVar( "fuzzik_disable_tmp_s", "0", FCVAR_ARCHIVE )

0 comments on commit b784f74

Please sign in to comment.