1. Post #1
    gamergg's Avatar
    May 2010
    16 Posts
    Alright, so I'm trying to make an M1 Garand SWEP, which turned out to be successful, but the only thing I need to implement is the little "ching" sound when you fire your last shot, along with the clip that flies out.
    Now, I have compiled the Primary Empty animation already, which includes the flying clip, but the problem now is that I don't know what to put in the shared.lua to make this work.

    Here is my code:
    if (SERVER) then
    	AddCSLuaFile("shared.lua")
    	SWEP.HoldType 		= "ar2"
    end
    
    if (CLIENT) then
    	SWEP.PrintName 		= "M1 Garand"
    	SWEP.Slot 			= 3
    	SWEP.SlotPos 		= 1
    	SWEP.IconLetter 		= "b"
    
    	killicon.AddFont("weapon_real_cs_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
    end
    
    SWEP.EjectDelay			= 0.05
    
    SWEP.Instructions 		= "Left click shoot, right click zoom in."
    
    SWEP.Base 				= "weapon_ava_base"
    
    SWEP.Spawnable 			= true
    SWEP.AdminSpawnable 		= true
    
    SWEP.ViewModel 			= "models/ava/v_ava_m1garand.mdl"
    SWEP.WorldModel 			= ""
    
    SWEP.Primary.Sound 		= Sound("ava/m1garand/fire.wav")
    SWEP.Primary.Recoil 		= 0.7
    SWEP.Primary.Damage 		= 56
    SWEP.Primary.NumShots 		= 1
    SWEP.Primary.Cone 		= 0.02
    SWEP.Primary.ClipSize 		= 8
    SWEP.Primary.Delay 		= 0.1
    SWEP.Primary.DefaultClip 	= 30
    SWEP.Primary.Automatic 		= false
    SWEP.Primary.Ammo 		= "smg1"
    
    SWEP.Secondary.ClipSize 	= -1
    SWEP.Secondary.DefaultClip 	= -1
    SWEP.Secondary.Automatic 	= false
    SWEP.Secondary.Ammo 		= "none"
    
    SWEP.IronSightsPos = Vector (-5.0694, -16.5654, 1.3494)
    SWEP.IronSightsAng = Vector (0.0744, -0.0751, -0.0075)
    	
    
    	function SWEP:Reload()
    if ( self.Reloadaftershoot > CurTime() ) then return end 
    	-- If you're firering, you can't reload
    
    	self.Weapon:DefaultReload(ACT_VM_RELOAD) 
    	-- Animation when you're reloading
    	
    
    	if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then
    		self.Weapon:EmitSound("ava/m1garand/reload.wav")
    		self.Weapon:EmitSound("ava/voices/Reload" .. math.random(1, 9) .. ".mp3")
    	-- When the current clip < full clip and the rest of your ammo > 0, then
    		
    		self.Owner:SetFOV( 0, 0.15 )
    		-- Zoom = 0
    
    		self:SetIronsights(false)
    end
    end
    
    function SWEP:Deploy()
    	self.Weapon:SendWeaponAnim( ACT_VM_DRAW )
    	self.Weapon:SetNextPrimaryFire(CurTime() + 1)
    	self.Weapon:EmitSound( "ava/m1garand/draw.wav" )
    	return true
    end

    (User was banned for this post ("Wrong section" - Gran PC))
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #2
    gamergg's Avatar
    May 2010
    16 Posts
    Help anyone?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #3
    amkoc's Avatar
    January 2011
    562 Posts
    Wrong forum, see the sticky
    Reply With Quote Edit / Delete Mac United States Show Events