All pastes #587781 Raw Edit

Miscellany

public lua v1 · immutable
#587781 ·published 2007-06-25 02:18 UTC
rendered paste body
if ( SERVER ) then	AddCSLuaFile( "shared.lua" )		SWEP.HoldType			= "pistol"	endif ( CLIENT ) then	SWEP.PrintName			= "Particle"				SWEP.Author				= "HexSpider"	SWEP.Contact			= "hexspider@atomworx.us"	SWEP.Purpose			= "Fires a high velocity projectile with deadly accuracy. Unlimited shots, powered by electricity!"	SWEP.Instructions		= "Point at target, pull trigger, repeat until sexually satisfied."	SWEP.Slot				= 1	SWEP.SlotPos			= 5	SWEP.IconLetter			= "u"		killicon.AddFont( "weapon_fiveseven", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )	end--Use the default CS weapon baseSWEP.Base				= "weapon_cs_base"--Make it not spawnable by normal users, but spawnable by adminSWEP.Spawnable			= trueSWEP.AdminSpawnable		= true--Set the view model of the fiveseven (what you see)SWEP.ViewModel			= "models/weapons/v_pist_fiveseven.mdl"--Set the world model of the fiveseven (what everyone else sees)SWEP.WorldModel			= "models/weapons/w_pist_fiveseven.mdl"--Set the weight of the weaponSWEP.Weight				= 5--Tell it whether or not it should automatically switch to/from this weaponSWEP.AutoSwitchTo		= falseSWEP.AutoSwitchFrom		= false--The sound this gun makes when it is firedSWEP.Primary.Sound			= Sound( "Weapon_USP.SilencedShot" )--The recoil of the gun when fired (we want it to be zero for a good admin gun)SWEP.Primary.Recoil			= 0--The damage this gun will deal out per shot! (we want it exceptionally high)SWEP.Primary.Damage			= 5000--How many shots?SWEP.Primary.NumShots		= 25--The cone of this weapon (accuracy)SWEP.Primary.Cone			= 0.1--How many bullets does this clip hold? (We'll make it one, becuase the clip will be endless)SWEP.Primary.ClipSize		= 1--Delay between shotsSWEP.Primary.Delay			= 0.2--How big should the default clip beSWEP.Primary.DefaultClip	= 1--Is the weapon fully automatic?SWEP.Primary.Automatic		= true--What ammo does it takeSWEP.Primary.Ammo			= "pistol"--No secondary fire, so just let it be -1, and none for ammo type.SWEP.Secondary.ClipSize		= -1SWEP.Secondary.DefaultClip	= -1SWEP.Secondary.Automatic	= falseSWEP.Secondary.Ammo			= "none"--Set the iron sights so that they CORRECTLY line up with the bullet trajectory.SWEP.IronSightsPos = Vector(4.5,3,3.36)SWEP.IronSightsAng = Vector(-.3,-.075,0)--Fire the weapon!function SWEP:PrimaryAttack()--If the weapon can attack...	if ( !self:CanPrimaryAttack() ) then return end--Fire bullet downrange at target	local bullet = { }	 	bullet.Num 			= 1	 	bullet.Src 			= self.Owner:GetShootPos()	-- Source 	 	bullet.Dir 			= self.Owner:GetAimVector()	-- Direction of bullet 	 	bullet.Spread 		= Vector( 0.02, 0.02, 0 )	-- Aim Cone 	 	bullet.Tracer		= 1							-- Show a tracer on every x bullets  	 	bullet.Force		= 4							-- Amount of force to give to phys objects 	 	bullet.Damage		= 5000	 	bullet.AmmoType 	= "Pistol" 	 	bullet.TracerName 	= "ToolTracer" 	self.Weapon:FireBullets( bullet )--BOOM! Emit the weapon sound for this weapon	self.Weapon:EmitSound(self.Primary.Sound)-- This doesn't trace the bullet, just where the player is looking ;)	--local trace = self.Owner:GetEyeTrace()--do the effects	self:ShootEffects()--Set a delay between shots of 0.08 seconds.	self.Weapon:SetNextPrimaryFire( CurTime() + 0.08 )--The admin gun has unlimited ammo so don't take a bullet away!	self:TakePrimaryAmmo( 0 )--[[ Old Gun Effects--Effect data for the toolgun effectlocal effectdata = EffectData()--Start the beam from the hit position of the bullet	effectdata:SetOrigin( trace.HitPos )--Trace the beam all the way back to the shoot position	effectdata:SetStart( self.Owner:GetShootPos() )--Attach the beam	effectdata:SetAttachment( 1 )--Set the entity for the beam	effectdata:SetEntity( self.Weapon )--Do the effect	util.Effect( "ToolTracer", effectdata )]]--end--Gun Effectsfunction SWEP:ShootEffects()--Muzzleflash	self.Owner:MuzzleFlash()--Attack animation	self.Owner:SetAnimation( PLAYER_ATTACK1 )--Weapon slide animation	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )end--Is the clip full (unnecessary, because clip is always full.)function SWEP:CanPrimaryAttack()	return trueend