Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.Base = "weapon_bo1_gasmask"
- if SERVER then
- SWEP.Weight = 1
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = true
- end
- if CLIENT then
- SWEP.Category = "Gas Masks" -- You can change everything in this first area.
- SWEP.PrintName = "Gas Mask"
- SWEP.Author = "Hidden"
- SWEP.Contact = "Steam, /LambdaHidden. Have a reason to talk and be nice <3."
- SWEP.Instructions = "Equip to put on/take off. Can be damaged."
- SWEP.Purpose = "Protects against hazardous gases."
- SWEP.Slot = 5
- SWEP.SlotPos = 7
- SWEP.ViewModelFOV = 62
- SWEP.WepSelectIcon = surface.GetTextureID("vgui/entities/weapon_bo1_gasmask" )
- SWEP.BounceWeaponIcon = false
- SWEP.DrawWeaponInfoBox = true
- SWEP.DrawCrosshair = false
- SWEP.DrawAmmo = true
- SWEP.SwayScale = 0
- SWEP.BobScale = 0
- function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha ) -- This function lets you use a square texture for the weapon selection menu. If you're using a rectangle, delete it.
- -- Set us up the texture
- surface.SetDrawColor( 255, 255, 255, alpha )
- surface.SetTexture( self.WepSelectIcon )
- local size = tall/2
- local halfsize = tall/4
- -- Draw that mother
- surface.DrawTexturedRect( x+wide/2 - halfsize, y+halfsize, size, size )
- -- Draw weapon info box
- self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )
- end
- end
- SWEP.Spawnable = true -- Makes the mask appear in the spawn menu.
- SWEP.AdminOnly = false -- Restricts the weapon to only be spawnable by admins.
- SWEP.ViewModel = "models/weapons/black_ops_1/c_gasmask.mdl" -- The first person view model. Needs to have ACT_VM_DRAW, ACT_VM_HOLSTER and ACT_VM_IDLE.
- SWEP.WorldModel = "models/weapons/black_ops_1/w_gasmask.mdl" -- This is the model that will be drawn on the player's head.
- SWEP.UseHands = true -- If your viewmodel supports it, set this to "true" to use your playermodel's hands in first person view.
- SWEP.BreathSound = "Weapon_BO1_GasMask.Breath" -- Breathing sound effect. Will loop as long as the mask is on.
- SWEP.BreathSoundMedium = nil -- This sound will replace the one above when the filter is half expired. Delete this line if you don't want it.
- SWEP.BreathSoundLow = nil -- This sound will replace the one above when the filter is 3/4 expired. Delete this line if you don't want it.
- SWEP.ScreenOverlay = "black_ops_1/screenoverlays/hazmatmask_00" -- Visor image that goes over your screen. If you have textures for damage, give them all the same name with a number in the end (higher means more damage).
- SWEP.DamageTypes = bit.bor(DMG_POISON, DMG_ACID, DMG_NERVEGAS, DMG_RADIATION, DMG_DROWN) -- These are what the mask will protect against. Change this to suit yours. Full list here: https://wiki.facepunch.com/gmod/Enums/DMG
- SWEP.FilterWarnSound = "" -- This sound plays when your filter is close to running out.
- SWEP.Primary.Ammo = "none" -- Changing this to "filter" gives you the ability to change filters. If you don't want that, keep this as "none".
- SWEP.Primary.DefaultClip = -1 -- The amount of filters you get when you pick the mask up. -1 disables this entirely.
- SWEP.FilterDurability = 0 -- Amount of chemical damage this mask's filter can take before expiring. Set to 0 for infinite.
- SWEP.Integrity = 50 -- Mask's health. Set to 0 for unbreakable.
- SWEP.IntegrityTextures = 4 -- As your mask takes damage, the screen overlay texture changes. This is the amount of textures it'll go through.
- SWEP.IntegritySkins = 0 -- Same as above, but for the model's skins.
- SWEP.NZHudIcon = Material("vgui/entities/weapon_bo1_gasmask") -- nZombies Rezzurrection HUD icons.
- SWEP.NZHudIcon_t7 = Material("vgui/entities/weapon_bo1_gasmask")
- SWEP.NZHudIcon_t7zod = Material("vgui/entities/weapon_bo1_gasmask")
- SWEP.NZHudIcon_t7tomb = Material("vgui/entities/weapon_bo1_gasmask")
- --[[
- VIEWMODEL ACT LIST, FOR YOUR QC
- ACT_VM_IDLE - idle, mask off
- ACT_VM_IDLE_DEPLOYED - idle, mask on
- ACT_VM_DRAW - put on
- ACT_VM_HOLSTER - take off
- ACT_VM_RELOAD - change filters, mask off
- ACT_VM_RELOAD_DEPLOYED - change filters, mask on
- ]]
- -- FROM THIS POINT ON, DON'T CHANGE ANYTHING UNLESS YOU REALLY KNOW WHAT YOU'RE DOING. This is here just so you understand what's going on under the hood.
- if JMod then
- JMod.AdditionalArmorTable = JMod.AdditionalArmorTable or {}
- JMod.AdditionalArmorTable["gasmask_rebirth"] = {
- PrintName = "\"Rebirth\" gas mask",
- mdl = "models/weapons/black_ops_1/w_gasmask.mdl",
- slots = {
- eyes = 1,
- mouthnose = 1
- },
- def = {
- [DMG_NERVEGAS] = 1,
- [DMG_RADIATION] = .75
- },
- dur = 50,
- chrg = {
- chemicals = SWEP.FilterDurability > 0 and SWEP.FilterDurability/20 or 2147483640
- },
- bon = "",
- siz = Vector(1, 1, 1),
- pos = Vector(0, .1, 0),
- ang = Angle(100, 180, 90),
- wgt = 5,
- mskmat = "",
- sndlop = "",
- ent = "weapon_bo1_gasmask",
- tgl = {
- pos = Vector(3, 3, 0),
- ang = Angle(190, 180, 90),
- eff = {},
- mskmat = "",
- sndlop = "",
- def = NonArmorProtectionProfile,
- slots = {
- eyes = 0,
- mouthnose = 0
- }
- }
- }
- end
- local BA2 = file.IsDir( "ba2", "LUA" )
- local filterName = BA2 and "BA2_GasmaskFilterPct" or "GasMaskFilter"
- game.AddAmmoType({
- name = "filter",
- force = 0
- })
- if SERVER then
- util.AddNetworkString("DrawGasMaskWM")
- end
- CreateConVar( "cl_gasmask_drawthirdperson", "1", bit.bor(FCVAR_ARCHIVE, FCVAR_USERINFO), "Determines if the gas mask model should be drawn on your head or not.", 0, 1 )
- CreateConVar( "cl_gasmask_preventswapiffresh", "1", bit.bor(FCVAR_ARCHIVE, FCVAR_USERINFO), "Prevent accidentally swapping filters if the one you have on is still fresh.", 0, 1 )
- CreateConVar( "cl_gasmask_filterwarning", "1", bit.bor(FCVAR_ARCHIVE, FCVAR_USERINFO), "Display a warning when the filter is close to running out.", 0, 1 )
- SWEP.NZPreventBox = true -- nZombies support.
- SWEP.NZSpecialCategory = "shield"
- SWEP.NZSpecialWeaponData = {MaxAmmo = 0, AmmoType = "none"}
- SWEP.Primary.Automatic = false
- SWEP.Primary.ClipSize = -1
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- function SWEP:SetupDataTables()
- self:NetworkVar("Float", 0, "RemainingFilter")
- self:NetworkVar("Int", 0, "Integrity")
- self:NetworkVar("Bool", 0, "Reloading")
- self:NetworkVar("Int", 1, "BreathSoundActual")
- self:NetworkVarNotify("Integrity", self.UpdateWorldModelDamage)
- self:NetworkVarNotify("RemainingFilter", self.OnFiltering)
- end
- function SWEP:Initialize()
- self:SetHoldType( "normal" )
- self.ActionDelay = CurTime()
- self:SetRemainingFilter(self.FilterDurability)
- self:SetIntegrity(self.Integrity)
- self:SetBreathSoundActual(-1)
- end
- function SWEP:EquipAmmo(newown)
- local wep = newown:GetWeapon(self:GetClass())
- --wep:SetIntegrity(math.max(self:GetIntegrity(), wep:GetIntegrity()))
- wep:SetIntegrity(math.max(self:GetIntegrity(), newown:GetNWInt( "GasMaskHealth", wep:GetIntegrity() )))
- newown:SetNWInt( "GasMaskHealth", wep:GetIntegrity() )
- if SERVER and self.IntegritySkins > 0 and newown:GetNWEntity("GasMaskOnFace") == wep then
- net.Start("DrawGasMaskWM")
- net.WriteEntity(newown)
- net.WriteString("update")
- net.WriteUInt(math.Remap(wep:GetIntegrity(), self.Integrity, 0, 0, self.IntegritySkins - 1), 8)
- net.Broadcast()
- end
- --self:TakePrimaryAmmo(1)
- end
- function SWEP:SwitchToLastWep()
- local own = self:GetOwner()
- if CLIENT then
- local prevswep = own:GetPreviousWeapon()
- if prevswep:IsWeapon() and prevswep:IsValid() then
- input.SelectWeapon( prevswep )
- else
- local weps = own:GetWeapons()
- input.SelectWeapon( weps[math.random(1, #weps)] )
- end
- end
- end
- function SWEP:Deploy()
- local own = self:GetOwner()
- local maskOnFace = own:GetNWEntity("GasMaskOnFace")
- local maskIsOn = own:GetNWBool("GasMaskIsOn")
- if self.Primary.Ammo == "none" and IsValid(maskOnFace) and maskOnFace != self then
- self:SendWeaponAnim(ACT_VM_IDLE)
- timer.Simple(0.1, function()
- own:PrintMessage( HUD_PRINTCENTER, "Take your current mask off first" )
- --own:ConCommand( "lastinv" )
- self:CallOnClient("SwitchToLastWep")
- --own:SelectWeapon(maskOnFace:GetClass())
- end)
- return true
- end
- self:SendWeaponAnim( maskIsOn and ACT_VM_IDLE_DEPLOYED or ACT_VM_IDLE ) -- This is so viewmodel anims work correctly.
- if self.Primary.Ammo == "none" then -- If this mask's filter can't expire, all you can do is put it on or take it off. Do that right away.
- if maskIsOn then
- self:TakeOff()
- else
- self:PutOn()
- end
- end
- if BA2 then
- own:SetAmmo(own:GetNWInt("BA2_GasmaskFilters"), "filter")
- end
- return true
- end
- function SWEP:PutOn()
- local own = self:GetOwner()
- -- FIRSTPERSON STUFF
- self:SendWeaponAnim(ACT_VM_DRAW) -- Play viewmodel animation for putting the mask on.
- self.ActionDelay = CurTime() + self:SequenceDuration()
- timer.Simple( self:SequenceDuration() + 0.1, function()
- if !IsValid(self) then return end
- --own:ConCommand( "pp_mat_overlay "..(self.ScreenOverlay) )
- own:SetNWString("GasMaskOverlay", self.ScreenOverlay) -- Draw screen overlay.
- if table.Count(own:GetWeapons()) != 1 and self.Primary.Ammo == "none" then -- If there's more to do with the mask than just putting it on, don't swap to another weapon.
- --own:ConCommand( "lastinv" )
- self:CallOnClient("SwitchToLastWep")
- if engine.ActiveGamemode() == "nzombies" and SERVER then -- Switch to last weapon.
- own:EquipPreviousWeapon()
- own:SetUsingSpecialWeapon(false)
- end
- end
- end )
- if !IsValid(self) then return end
- timer.Simple( self:SequenceDuration() + 0.1, function()
- if !IsValid(self) then return end
- if SERVER then -- The sound plays twice in third person if I don't do this check.
- if !BA2 then
- --own:EmitSound(self.BreathSound)
- --self.BreathSoundActual = own:StartLoopingSound(self.BreathSound)
- self:SetBreathSoundActual(own:StartLoopingSound(self.BreathSound))
- end -- Start breathing sound.
- end
- end )
- -- THIRDPERSON STUFF
- self:SetHoldType( "normal" ) -- No good anim for putting on a mask, so instead we play with holdtypes.
- timer.Simple(self:SequenceDuration()*0.25, function()
- if !IsValid(self) then return end
- self:SetHoldType( "melee2" )
- end)
- timer.Simple(self:SequenceDuration()*0.4, function()
- if !IsValid(self) then return end
- self:SetHoldType( "camera" )
- if own:GetInfoNum("cl_gasmask_drawthirdperson", 1) > 0 then
- net.Start("DrawGasMaskWM")
- net.WriteEntity(own)
- net.WriteString(self.WorldModel)
- net.WriteUInt(self.IntegritySkins > 0 and math.Remap(self:GetIntegrity(), self.Integrity, 0, 0, self.IntegritySkins - 1) or 0, 8)
- if SERVER then
- net.Broadcast()
- else
- net.SendToServer()
- end
- end
- if SERVER then
- own:SetNWInt("GasMaskDamageTypes", self.DamageTypes) -- Add protective effects.
- if self.FilterDurability > 0 then
- if self:GetRemainingFilter() > 0 then
- own:SetNWInt(filterName, self:GetRemainingFilter())
- if JMod then
- for k, v in pairs(own.EZarmor.items) do
- if v.name == "gasmask_rebirth" then
- v.chrg.chemicals = self:GetRemainingFilter()/20
- break
- end
- end
- end
- own.gasmasked = true -- GBombs 5 compatibility, doubles up as a variable for checking if the filter works.
- end
- else
- own:SetNWInt(filterName, BA2 and 2147483000 or -1)
- own.gasmasked = true
- end
- own:SetNWBool("GasMaskIsOn", true)
- if BA2 then
- print("Bio-Annihilation 2 is installed, adapting gas masks...")
- own:SetNWBool("BA2_GasmaskOn", true)
- end
- own:SetNWEntity("GasMaskOnFace", self)
- own:SetNWBool("GasMaskCanBreak", self.Integrity > 0)
- own:SetNWInt("GasMaskHealth", self:GetIntegrity())
- own:SetNWInt("GasMaskMaxHealth", self.Integrity)
- own:SetNWInt("GasMaskHealthTextures", self.IntegrityTextures)
- own:SetNWInt("GasMaskHealthSkins", self.IntegritySkins)
- if JMod then JMod.EZ_Equip_Armor(own, "gasmask_rebirth") end -- JMod support.
- end
- end)
- timer.Simple( self:SequenceDuration()*0.75, function()
- if !IsValid(self) then return end
- --own:SetDSP(30, false )
- self:SetHoldType( "normal" )
- end )
- end
- function SWEP:TakeOff()
- local own = self:GetOwner()
- self:SetHoldType( "camera" )
- self:SendWeaponAnim(ACT_VM_HOLSTER) -- Play viewmodel animation for taking the mask off.
- timer.Simple(0.2, function()
- if !IsValid(self) then return end
- self:SetHoldType( "melee2" )
- own:SetNWInt("GasMaskDamageTypes", 0) -- Remove protective effects.
- self:SetIntegrity(own:GetNWInt("GasMaskHealth"))
- net.Start("DrawGasMaskWM")
- net.WriteEntity(own)
- net.WriteString("")
- net.WriteUInt(0, 8)
- if SERVER then
- net.Broadcast()
- else
- net.SendToServer()
- end
- end)
- timer.Simple(0.4, function()
- if !IsValid(self) then return end
- self:SetHoldType( "normal" )
- end)
- self.ActionDelay = CurTime() + self:SequenceDuration()
- own:SetNWString("GasMaskOverlay", "") -- Remove screen overlay.
- if SERVER then
- timer.Simple( self.ActionDelay - CurTime(), function()
- if !IsValid(self) or own:GetActiveWeapon() != self then return end
- --[[if timer.Exists("GasMaskFilterTime"..own:EntIndex()) then
- print( "takeoff", timer.TimeLeft("GasMaskFilterTime"..own:EntIndex()) )
- self:SetRemainingFilter(timer.TimeLeft("GasMaskFilterTime"..own:EntIndex()))
- timer.Remove("GasMaskFilterTime"..own:EntIndex())
- end]]
- self:SetRemainingFilter( own:GetNWInt(filterName) )
- if table.Count(own:GetWeapons()) != 1 and self.Primary.Ammo == "none" then
- --own:ConCommand( "lastinv" )
- self:CallOnClient("SwitchToLastWep")
- if engine.ActiveGamemode() == "nzombies" then -- Switch to last weapon.
- own:EquipPreviousWeapon()
- own:SetUsingSpecialWeapon(false)
- end
- end
- end )
- end
- own:SetNWBool( "GasMaskIsOn", false )
- if BA2 then own:SetNWBool("BA2_GasmaskOn", false) end
- own:SetNWEntity("GasMaskOnFace", NULL)
- if JMod and SERVER then
- for k, v in pairs(own.EZarmor.items) do
- if v.name == "gasmask_rebirth" then
- JMod.RemoveArmorByID(own, k)
- break
- end
- end
- end
- own.gasmasked = false
- --own:StopSound(self.BreathSound)
- --own:StopLoopingSound(self.BreathSoundActual)
- own:StopLoopingSound(self:GetBreathSoundActual())
- self:SetBreathSoundActual(-1)
- if BA2 then BA2_GasmaskSound(own) end
- --own:SetDSP(0, false )
- end
- function SWEP:FireAnimationEvent(pos, ang, event, options) -- Animation events in the viewmodel toggle the sound muffling.
- local own = self:GetOwner()
- if event == 9001 then
- own:SetDSP(30, false )
- elseif event == 9011 then
- own:SetDSP(0, false )
- end
- end
- function SWEP:Holster(wep)
- if self.ActionDelay > CurTime() then
- return false
- end
- return true
- end
- function SWEP:NZSpecialHolster(wep)
- return true
- end
- function SWEP:PrimaryAttack()
- if self:GetNextPrimaryFire() > CurTime() then return end -- Prevent overlapping actions.
- if self.Primary.Ammo != "none" or table.Count(self.Owner:GetWeapons()) == 1 then
- local maskIsOn = self.Owner:GetNWBool("GasMaskIsOn")
- if maskIsOn then
- if self.Owner:GetNWEntity("GasMaskOnFace") != self then
- self.Owner:PrintMessage( HUD_PRINTCENTER, "Take your current mask off first" )
- self:SetNextPrimaryFire(CurTime() + 1)
- return
- end
- self:TakeOff()
- else
- self:PutOn()
- end
- self:SetNextPrimaryFire(CurTime() + self:SequenceDuration() + 0.1)
- end
- end
- function SWEP:SecondaryAttack()
- return false
- end
- function SWEP:Reload()
- if self:GetReloading() or self:Ammo1() <= 0 then return end
- local own = self:GetOwner()
- if own:GetInfoNum("cl_gasmask_preventswapiffresh", 0) > 0 and self:GetRemainingFilter() > self.FilterDurability/4 then
- own:PrintMessage( HUD_PRINTCENTER, "The filter is still fresh" )
- return
- end
- local maskOnFace = own:GetNWEntity("GasMaskOnFace")
- local act = ACT_VM_RELOAD
- if maskOnFace == self then
- act = ACT_VM_RELOAD_DEPLOYED
- own:SetNWInt(filterName, self.FilterDurability)
- if JMod then
- for k, v in pairs(own.EZarmor.items) do
- if v.name == "gasmask_rebirth" then
- v.chrg.chemicals = self.FilterDurability/20
- break
- end
- end
- end
- own.gasmasked = true -- GBombs 5 compatibility.
- end
- own:StopLoopingSound(self:GetBreathSoundActual())
- self:SetBreathSoundActual(-1)
- if BA2 then BA2_GasmaskSound(own) end
- self:SendWeaponAnim(act)
- self:SetReloading(true)
- self.ActionDelay = CurTime() + self:SequenceDuration()
- self:TakePrimaryAmmo(1)
- if BA2 then
- own:SetNWInt("BA2_GasmaskFilters", own:GetAmmoCount("filter"))
- end
- self:SetRemainingFilter(self.FilterDurability)
- timer.Create("GasMaskChangeFilter"..own:EntIndex(), self:SequenceDuration()+0.1, 1, function()
- if !IsValid(self) or !IsValid(own) or own:GetActiveWeapon() !=self then return end
- self:SetReloading(false)
- if maskIsOn then
- if BA2 then
- BA2_GasmaskSound(own, "ba2/gasmask/mask_breathe_light.wav")
- else
- --own:EmitSound(self.BreathSound)
- --self.BreathSoundActual = own:StartLoopingSound(self.BreathSound)
- if SERVER then self:SetBreathSoundActual(own:StartLoopingSound(self.BreathSound)) end
- end
- end
- end)
- end
- SWEP.BreathingDifficulty = 0
- function SWEP:OnFiltering(name, old, new)
- if new == self.FilterDurability then
- self.FilterWarningGiven = false
- self.BreathingDifficulty = 0
- end
- if new <= self.FilterDurability/2 and self.BreathingDifficulty == 0 and self.BreathSoundMedium != nil and SERVER then
- self.BreathingDifficulty = 1
- ---self:StopLoopingSound(self.BreathSoundActual)
- self:StopLoopingSound(self:GetBreathSoundActual())
- --self.BreathSoundActual = self:StartLoopingSound(self.BreathSoundMedium)
- self:SetBreathSoundActual(self:StartLoopingSound(self.BreathSoundMedium))
- end
- local own = self:GetOwner()
- if new <= self.FilterDurability/4 then
- if IsValid(own) and own:GetInfoNum("cl_gasmask_filterwarning", 1) and !self.FilterWarningGiven then
- self.FilterWarningGiven = true
- if self.BreathSoundLow != nil and SERVER then
- self.BreathingDifficulty = 2
- --self:StopLoopingSound(self.BreathSoundActual)
- self:StopLoopingSound(self:GetBreathSoundActual())
- --self.BreathSoundActual = self:StartLoopingSound(self.BreathSoundLow)
- self:SetBreathSoundActual(self:StartLoopingSound(self.BreathSoundLow))
- end
- --own:PrintMessage( HUD_PRINTCENTER, "Filter low" )
- if CLIENT then
- if self.FilterWarnSound then surface.PlaySound(self.FilterWarnSound) end
- notification.AddLegacy( "Filter low", NOTIFY_HINT, 4 )
- end
- end
- end
- end
- function SWEP:OnRemove()
- local own = self.OwnerHack
- if IsValid(own) then
- timer.Remove("GasMaskChangeFilter"..own:EntIndex())
- own:SetNWBool( "GasMaskIsOn", false )
- if BA2 then own:SetNWBool("BA2_GasmaskOn", false) end
- own:SetNWEntity("GasMaskOnFace", NULL)
- own:SetNWInt(filterName, 0)
- own.gasmasked = false
- net.Start("DrawGasMaskWM")
- net.WriteEntity(own)
- net.WriteString("")
- net.WriteUInt(0, 8)
- if SERVER then
- net.Broadcast()
- else
- net.SendToServer()
- end
- --own:StopSound(self.BreathSound)
- --own:StopLoopingSound(self.BreathSoundActual)
- own:StopLoopingSound(self:GetBreathSoundActual())
- self:SetBreathSoundActual(-1)
- if BA2 then BA2_GasmaskSound(own) end
- --own:ConCommand( "pp_mat_overlay ()" )
- own:SetNWInt("GasMaskDamageTypes", 0)
- own:SetNWString("GasMaskOverlay", "")
- own:SetDSP(0, false )
- end
- end
- function SWEP:OwnerChanged()
- if !IsValid(self:GetOwner()) then
- if !IsValid(self.OwnerHack) then return end
- timer.Remove("GasMaskChangeFilter"..self.OwnerHack:EntIndex())
- if self.OwnerHack:GetNWBool("GasMaskIsOn") then
- --[[if timer.Exists("GasMaskFilterTime"..self.OwnerHack:EntIndex()) then
- --print( "ownerchanged", timer.TimeLeft("GasMaskFilterTime"..self.OwnerHack:EntIndex()) )
- self:SetRemainingFilter(timer.TimeLeft("GasMaskFilterTime"..self.OwnerHack:EntIndex()))
- timer.Remove("GasMaskFilterTime"..self.OwnerHack:EntIndex())
- end]]
- self:SetRemainingFilter( self.OwnerHack:GetNWInt(filterName) )
- self:SetIntegrity(self.OwnerHack:GetNWInt("GasMaskHealth"))
- end
- self:OnRemove()
- else
- self.OwnerHack = self:GetOwner()
- end
- end
- function SWEP:UpdateWorldModelDamage(name, old, new)
- if self.IntegritySkins > 0 then
- self:SetSkin( math.Remap(new, self.Integrity, 0, 0, self.IntegritySkins - 1) )
- end
- local own = self:GetOwner()
- if IsValid(own) and IsValid(own.GasMask) then
- own.GasMask:SetSkin(self:GetSkin())
- end
- end
- function SWEP:DrawWorldModel( flags )
- if !IsValid(self:GetOwner()) then
- self:DrawModel(flags)
- end
- end
Add Comment
Please, Sign In to add comment