I’ve searched high and low for one.
I know theirs one in the downloads page, but alas does not work for Garry’s Mod 10.
Any out there ?
Well here’s the zombie panic double barrel model: http://www.facepunch.com/showthread.php?t=820166
Now all you need is a coder.
Well does any one think they could code that,
or make this Gmod10 compatible?
I don’t know why it wont work for me. The in game model doesn’t show up.
this
[lua]
if ( SERVER ) then
resource.AddFile("models/weapons/v_91a.mdl")
resource.AddFile("models/weapons/w_shot_m3super90.mdl")
util.PrecacheModel("models/weapons/v_91a.mdl")
util.PrecacheModel("models/weapons/w_shot_m3super90.mdl")
AddCSLuaFile( "shared.lua" )
SWEP.HoldType = "ar2"
end
if ( CLIENT ) then
SWEP.PrintName = "Double Barrel Shotgun Beta"
SWEP.Author = "kikkomen"
SWEP.Slot = 3
SWEP.SlotPos = 357
SWEP.IconLetter = "k"
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = true
SWEP.ViewModelFOV = 45
SWEP.ViewModelFlip = false
SWEP.CSMuzzleFlashes = true
SWEP.DrawWeaponInfoBox = true
killicon.AddFont( "weapon_pumpshotgun", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
end
SWEP.Base = “rg_base”
SWEP.Category = “Other”
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.ViewModel = “models/weapons/v_91a.mdl”
SWEP.WorldModel = “models/weapons/w_shot_m3super90.mdl”
SWEP.MuzzleEffect = “rg_muzzle_rifle” – This is an extra muzzleflash effect
– Available muzzle effects: rg_muzzle_grenade, rg_muzzle_highcal, rg_muzzle_hmg, rg_muzzle_pistol, rg_muzzle_rifle, rg_muzzle_silenced, none
SWEP.ShellEffect = “rg_shelleject_rifle” – This is a shell ejection effect
– Available shell eject effects: rg_shelleject, rg_shelleject_rifle, rg_shelleject_shotgun, none
SWEP.MuzzleAttachment = “1” – Should be “1” for CSS models or “muzzle” for hl2 models
SWEP.ShellEjectAttachment = “2” – Should be “2” for CSS models or “1” for hl2 models
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.Primary.Sound = Sound( “Weapon_Shotgun.Single” )
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage = 15
SWEP.SemiRPM = 550
SWEP.AvailableFireModes = {“UnderWaterShotgun”}
SWEP.Primary.NumShots = 6
SWEP.Primary.Cone = 0.90
SWEP.Primary.ClipSize = 2
SWEP.Primary.Delay = 0.95
SWEP.Primary.DefaultClip = 16
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = “buckshot”
SWEP.DrawFireModes = true
SWEP.IronSightZoom = 1.2
SWEP.ScopeZooms = {5,10}
SWEP.UseScope = false
SWEP.ScopeScale = 0.4
SWEP.DrawParabolicSights = false
SWEP.MinRecoil = 0.0
SWEP.MaxRecoil = 0.0
SWEP.DeltaRecoil = 0.1
SWEP.RecoverTime = 1
SWEP.MinSpread = 0.01
SWEP.MaxSpread = 0.02
SWEP.DeltaSpread = 0.003
SWEP.MinSpray = 0.2
SWEP.MaxSpray = 0.5
SWEP.DeltaSpray = 0.2
function SWEP:ShootEffects()
local PlayerPos = self.Owner:GetShootPos()
local PlayerAim = self.Owner:GetAimVector()
self.Weapon:EmitSound(self.Primary.Sound)
self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) -- View model animation
self.Owner:MuzzleFlash() -- Crappy muzzle light
self.Owner:SetAnimation(PLAYER_ATTACK1) -- 3rd Person Animation
local fx = EffectData()
fx:SetEntity(self.Weapon)
fx:SetOrigin(PlayerPos)
fx:SetNormal(PlayerAim)
fx:SetAttachment(self.MuzzleAttachment)
util.Effect(self.MuzzleEffect,fx) -- Additional muzzle effects
local fx = EffectData()
fx:SetEntity(self.Weapon)
fx:SetNormal(PlayerAim)
fx:SetAttachment(self.ShellEjectAttachment)
util.Effect(self.ShellEffect,fx) -- Shell ejection
end
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”
SWEP.IronSightsPos = Vector( 5.7, -3, 3 )
SWEP.FireModes = {} – Don’t touch this!
SWEP.FireModes.UnderWaterShotgun = {} – Our firemode’s main table.
– If you want this firemode to be used, the part after the SWEP.FireModes. (in this case, “UnderWaterShotgun”) should be defined as a string in the SWEP.AvailableFireModes table
SWEP.UWShotgunRPM = 130 – We can define our own variables for this firemode if we so desire
SWEP.FireModes.UnderWaterShotgun.NumBullets = 6 – Either way of adding variables is fine, as long as we call the right variable name when we need it
– Generally, a firemode consists of 4 main functions: the FireFunction, InitFunction,RevertFunction, and HUDDrawFunction
– This function is called when the player attacks and the firemode is active.
SWEP.FireModes.UnderWaterShotgun.FireFunction = function(self)
if not self:CanFire(self.Weapon:Clip1()) then return end -- Do we have enough ammo to fire?
-- Note: if you want your firemode to use the secondary ammo, I reccomend replacing self.Weapon:Clip1() with self.Weapon:Ammo2()
if not self.OwnerIsNPC then
self:TakePrimaryAmmo(1) -- NPCs get infinate ammo, as they don't know how to reload
-- ^ obviously, this should be self:TakeSecondaryAmmo(1) if your firemode uses secondary ammo.
end
--Fire ze bullets!
self:RGShootBullet(
18, --Damage per shot
self.BulletSpeed, --Speed of the bullet (this variable is derived from self.MuzzleVelocity)
0.04, -- Bullet Spread
0, -- Bullet Spray
Vector(0,0,0), -- Vector corresponding to the direction the gun is currently spraying ("SprayVec")
self.FireModes.UnderWaterShotgun.NumBullets) -- How many bullets to fire
-- Note that some paramters (damage per shot, spread, spray, recoil) were not defined in outside variables, but rather inside the firefunction itself. How you want to handle this is up to you.
-- Apply recoil and spray
self:ApplyRecoil(
2, -- Recoil
2) -- Spray
self:ShootEffects() -- Animations, sounds, muzzle flash, shell ejection...
-- Note: the functions used here (RGShootBullet, ApplyRecoil, and ShootEffects) are defined under rg_base/shared.lua
end
– This function initializes the firemode. It can be used to update variables within the SWEP’s table, such as the firing delay.
SWEP.FireModes.UnderWaterShotgun.InitFunction = function(self)
-- self.Primary.Delay and self.Primary.Automatic should be set in every firemode function, as there is no true default value for these variables
self.Primary.Automatic = false -- 'tis not an automatic shotgun
self.Primary.Delay = 25/self.UWShotgunRPM -- This is how you convert from RPM to delay between shots
self.FiresUnderwater = false -- This makes it able to be fired underwater
-- Change the effects to be more shotgunny
self.ShellEffect = "rg_muzzle_highcal"
self.MuzzleEffect = "rg_shelleject_shotgun"
self.Primary.Sound = Sound("Weapon_Shotgun.Single")
if CLIENT then
-- self.FireModeDrawTable is a predefined clientside table we can use to store stuff for drawing info about this firemode to the HUD. You can add/call anything you want to/from it.
self.FireModeDrawTable.x = 0.037*surface.ScreenWidth() -- These variables are the position on the player's screen that the firemode's icon will be drawn.
self.FireModeDrawTable.y = 0.912*surface.ScreenHeight()
end
end
– In this function, we should undo what we did in the init function
SWEP.FireModes.UnderWaterShotgun.RevertFunction = function(self)
self.FiresUnderwater = false -- Change this back to its default value (ie what you defined it as above) so that we don't screw up other firemodes.
-- If we didn't do this, then once we changed to our "UnderWaterShotgun" firemode, every firemode would be able to fire underwater.
-- Revert the effects too
self.ShellEffect = "rg_shelleject_rifle"
self.MuzzleEffect = "rg_muzzle_rifle"
self.Primary.Sound = Sound("Weapon_Shotgun.Single")
-- self.Primary.Delay and self.Primary.Automatic don't need to be reset because they don't really have defaults.
-- Also, there is no need to revert any values in self.FireModeDrawTable, as those are generally firemode specific.
end
– This function can be used to give the player a visual indication of his current firemode. It is called under SWEP:DrawHUD() every client frame.
SWEP.FireModes.UnderWaterShotgun.HUDDrawFunction = function(self)
surface.SetFont("rg_firemode") -- This custom font contains the HL2 weapon icons (see "half-life 2/hl2/resource/halflife2.ttf")
surface.SetTextPos(self.FireModeDrawTable.x,self.FireModeDrawTable.y) -- Draw this font to the position we defined in the init function.
surface.SetTextColor(255,220,0,200) -- Default HUD color
surface.DrawText("s") -- "s" corresponds to the hl2 shotgun ammo icon in this font
-- Note: you don't have to draw a little icon in the corner of the screen if you don't want to. If you feel like it, you can make this function repeatedly flash goatse to the player's screen (note: don't actually do this). It's pretty flexible.
end
/---------------------------------------------------------
Reload does nothing
---------------------------------------------------------/
function SWEP:Reload()
//if ( CLIENT ) then return end
self:SetIronsights( false )
// Already reloading
if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then return end
// Start reloading if we can
if ( self.Weapon:Clip1() < self.Primary.ClipSize && self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
self.Weapon:SetNetworkedBool( "reloading", true )
self.Weapon:SetVar( "reloadtimer", CurTime() + 0.3 )
self.Weapon:SendWeaponAnim( ACT_VM_RELOAD )
end
end
/---------------------------------------------------------
Think does nothing
---------------------------------------------------------/
function SWEP:Think()
if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then
if ( self.Weapon:GetVar( "reloadtimer", 0 ) < CurTime() ) then
// Finsished reload -
if ( self.Weapon:Clip1() >= self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 ) then
self.Weapon:SetNetworkedBool( "reloading", false )
return
end
// Next cycle
self.Weapon:SetVar( "reloadtimer", CurTime() + 0.3 )
self.Weapon:SendWeaponAnim( ACT_VM_RELOAD )
// Add ammo
self.Owner:RemoveAmmo( 1, self.Primary.Ammo, false )
self.Weapon:SetClip1( self.Weapon:Clip1() + 1 )
// Finish filling, final pump
if ( self.Weapon:Clip1() >= self.Primary.ClipSize || self.Owner:GetAmmoCount( self.Primary.Ammo ) <= 0 ) then
self.Weapon:SendWeaponAnim( ACT_SHOTGUN_RELOAD_FINISH )
else
end
end
end
end
[/lua]