All pastes #493736 Raw Edit

durundal

public text v1 · immutable
·published 2007-05-17 22:18 UTC
rendered paste body

if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	
	SWEP.HoldType			= "smg"
	
end

if ( CLIENT ) then

	SWEP.PrintName			= "Custom Spawn"			
	SWEP.Author				= "Durundal"
        SWEP.Instructions   = "Left Click:Spawn"
	SWEP.Slot				= 6
	SWEP.SlotPos			= 1
	SWEP.IconLetter			= "a"
	SWEP.ViewModelFOV      = 70
	
	killicon.AddFont( "weapon_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
	
end


SWEP.Base				= "weapon_cs_base"

SWEP.Spawnable			= false
SWEP.AdminSpawnable		= true

SWEP.ViewModel			= "models/weapons/v_mosin.mdl"
SWEP.WorldModel			= "models/weapons/w_mosin.mdl"
SWEP.ViewModelFlip              = false

SWEP.Weight				= 1
SWEP.AutoSwitchTo		= true
SWEP.AutoSwitchFrom		= true

SWEP.ForceApply    = 60 -- Amount of force to give to phys objects
SWEP.TracerFreq    = 1 -- Show a tracer on every x bullets 

SWEP.Primary.Sound			= Sound( "weapons/k98_shoot2.wav" )
SWEP.Primary.Recoil			= 2
SWEP.Primary.Damage			= 0
SWEP.Primary.NumShots		= 1
SWEP.Primary.Cone			= 0.01
SWEP.Primary.ClipSize		= 5
SWEP.Primary.Delay			= 1.2
SWEP.Primary.DefaultClip	= 7000
SWEP.Primary.Automatic		= false
SWEP.Primary.Ammo			= "smg1"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= false
SWEP.Secondary.Ammo			= ""

SWEP.IronSightsPos   = Vector( -5.15, -11, 2.25 )
SWEP.IronSightsAng   = Vector( 1.25, 1.5, -5.5 )


function SWEP:PrimaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
    self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
   
    if ( !self:CanPrimaryAttack() ) then return end
   

    self.Weapon:EmitSound( self.Primary.Sound )
   
 
    self:CSShootBullet( self.Primary.NumShots, self.Primary.Cone )
   
	if ( SERVER ) then
		local tr = self.Owner:GetEyeTrace() 
		local SpawnPos = tr.HitPos 
		self.Owner:SetNetworkedVector( "SpawnPos", SpawnPos )
	end

	if ( CLIENT ) then
		local SpawnPos = self.Owner:GetNetworkedVector("SpawnPos")
			if SpawnPos.x == 65536 then return end
		local spawn = {}
			spawn.x = SpawnPos.x
			spawn.y = SpawnPos.y
			spawn.z = SpawnPos.z
		spawn = Vector(spawn.x,spawn.y,spawn.z)
		local ang = Angle(0, 0 , 0)
	end
end