Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GET /getinstall_003/?v=31333200&u=373635363131393739373839373730303700&scriptid=31333139383400&rev=3700&key=e5ca8ba6e55e67283a3a997fdd834a0c HTTP/1.1
- Host: toyboxapi.garrysmod.com
- Accept: */*
- HTTP/1.1 200 OK
- Content-Type: text/html; charset=UTF-8
- Date: Tue, 17 Jul 2012 16:11:25 GMT
- Server: Apache/2.2.22 (Amazon)
- X-Powered-By: PHP/5.3.13
- Content-Length: 10318
- Connection: keep-alive
- "script"
- {
- ."uid" .."weapon_131984"
- ."scriptid" ."131984"
- ."name" .."NyanRevolver"
- ."type" .."weapon"
- ."revision" ."17"
- .
- ."content"
- .{
- .."content_53924"
- ..{
- ..."id" .."53924"
- ..."rev".."1"
- ..."name"."sound/weapons/nyan_revolver/nyancatsoundfx.wav"
- ..."url".."http://toyboxcontent.s3.amazonaws.com/53924?AWSAccessKeyId=AKIAIOPONRLV2V7FJNSQ&Expires=1342541845&Signature=G0os5j4WrhDnMUEywOI1qz3K1B8%3D"
- ..."size"."1348257"
- ..}
- .}
- }
- -- SWEP template
- -- Version 0.2 BETA
- -- All code written by Aric Blunk (mblunk)
- -- Effect settings
- SWEP.PrintName = "NyanRevolver" -- The name of the weapon
- SWEP.Slot = 1 -- The weapon slot this SWEP belongs in (0-5)
- SWEP.SlotPos = 2 -- The position in the slot this weapon belongs in (0-infinity, DO NOT COVER UP EXISTING WEAPONS)
- SWEP.DrawAmmo = true -- Display how much ammo this weapon has left?
- SWEP.DrawCrosshair = true -- Display the crosshair?
- SWEP.ViewModel = "models/weapons/v_357.mdl" -- First person model
- SWEP.WorldModel = "models/weapons/w_357.mdl" -- Third person model
- SWEP.ReloadSound = "weapons/pistol/pistol_reload1.wav" -- What sound should this weapon make when reloaded?
- -- Other settings
- SWEP.Weight = 10 -- How powerful is this weapon?
- SWEP.AutoSwitchTo = false -- Automatically switch to this weapon if it's more powerful than what we're already holding
- SWEP.AutoSwitchFrom = false -- Automatically switch from this weapon if what we pick up is more powerful than this weapon
- SWEP.Spawnable = true -- Can clients spawn this weapon?
- SWEP.AdminSpawnable = true -- Can admins spawn this weapon?
- --SWEP.AutoReload = true -- Automatically reload if the clip is empty? (DOES NOT WORK YET)
- -- Weapon info
- SWEP.Author = "David Baxter(dynamited3)" -- Who made this
- SWEP.Contact = "" -- How you can contact who made this
- SWEP.Purpose = "To have fun!" -- Why was this made?
- SWEP.Instructions = "" -- How do you use this?
- -- Primary fire settings
- SWEP.Primary.Sound = "weapons/nyan_revolver/nyancatsoundfx.wav" -- What sound should this weapon make when fired?
- SWEP.Primary.Damage = 10000000 -- How much damage each bullet inflicts
- SWEP.Primary.NumShots = 50 -- How many bullets we should shoot each time we fire the weapon (Use more than one for shotguns and the like)
- SWEP.Primary.Recoil = 0.5 -- How much we should punch the view
- SWEP.Primary.Cone = 2 -- How many degrees the bullets can spread (90 max)
- SWEP.Primary.Delay = 0.01 -- How many seconds between each shot
- SWEP.Primary.ClipSize = 18 -- How big the clip is
- SWEP.Primary.DefaultClip = 256 -- How much ammo the gun comes with
- SWEP.Primary.Tracer = 1 -- Fire a tracer round every so many bullets
- SWEP.Primary.Force = 1000000 -- How much force the bullets have when they hit physics objects
- SWEP.Primary.TakeAmmoPerBullet = false -- Take 1 ammo for each bullet = true, take 1 ammo for each shot = false
- SWEP.Primary.Automatic = false -- Is this weapon automatic?
- SWEP.Primary.Ammo = "pistol" -- Primary ammo type
- -- Secondary fire settings
- SWEP.Secondary.Sound = "" -- What sound should this weapon make when fired?
- SWEP.Secondary.Damage = 0 -- How much damage each bullet inflicts
- SWEP.Secondary.NumShots = 0 -- How many bullets we should shoot each time we fire the weapon (Use more than one for shotguns and the like)
- SWEP.Secondary.Recoil = 0 -- How much we should punch the view
- SWEP.Secondary.Cone = 0 -- How many degrees the bullets can spread (90 max)
- SWEP.Secondary.Delay = 0 -- How many seconds between each shot
- SWEP.Secondary.ClipSize = 0 -- How big the clip is
- SWEP.Secondary.DefaultClip = 0 -- How much ammo the gun comes with
- SWEP.Secondary.Tracer = 0 -- Fire a tracer round every so many bullets
- SWEP.Secondary.Force = 0 -- How much force the bullets have when they hit physics objects
- SWEP.Secondary.TakeAmmoPerBullet = false -- Take 1 ammo for each bullet = true, take 1 ammo for each shot = false
- SWEP.Secondary.Automatic = false -- Is this weapon automatic?
- SWEP.Secondary.Ammo = "" -- Secondary ammo type
- -- Functions that we can use to run certain code at certain times
- -- I don't suggest you play around with this stuff unless you know what you're doing
- function SWEP:Initialize() -- Called when this script is run
- end
- function SWEP:PrimaryAttack() -- Called when we press primary fire
- if ( !self:CanPrimaryAttack() ) then return end -- If we shouldn't be shooting, don't shoot
- local bullet = {} -- Set up the shot
- bullet.Num = self.Primary.NumShots -- How many bullets we'll fire at once
- bullet.Src = self.Owner:GetShootPos() -- Where the bullets are coming from
- bullet.Dir = self.Owner:GetAimVector() -- Where the bullets are headed
- bullet.Spread = Vector( self.Primary.Cone / 90, self.Primary.Cone / 90, 0 ) -- Bullet spread
- bullet.Tracer = self.Primary.Tracer -- Set up tracer rounds
- bullet.Force = self.Primary.Force -- Set the bullet's force
- bullet.Damage = self.Primary.Damage -- Define how much damage each bullet does
- bullet.AmmoType = self.Primary.Ammo -- Define what kind of ammo we're using
- self.Owner:FireBullets( bullet ) -- Shoot!
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) -- View model animation
- self.Owner:MuzzleFlash() -- Crappy muzzle light
- self.Owner:SetAnimation( PLAYER_ATTACK1 ) -- 3rd Person Animation
- self.Weapon:EmitSound("weapons/nyan_revolver/nyancatsoundfx.wav") -- Make shooty noises
- self.Owner:ViewPunch(Angle( -self.Primary.Recoil, 0, 0 ))
- if (self.Primary.TakeAmmoPerBullet) then -- Set up ammo loss
- self:TakePrimaryAmmo(self.Primary.NumShots)
- else
- self:TakePrimaryAmmo(1)
- end
- self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) -- Don't shoot again until the delay has expired
- end
- function SWEP:SecondaryAttack() -- Called when we press secondary fire
- if ( !self:CanSecondaryAttack() ) then return end -- If we shouldn't be shooting, don't shoot
- local bullet = {} -- Set up the shot
- bullet.Num = self.Secondary.NumShots -- How many bullets we'll fire at once
- bullet.Src = self.Owner:GetShootPos() -- Where the bullets are coming from
- bullet.Dir = self.Owner:GetAimVector() -- Where the bullets are headed
- bullet.Spread = Vector( self.Secondary.Cone / 90, self.Secondary.Cone / 90, 0 ) -- Bullet spread
- bullet.Tracer = self.Secondary.Tracer -- Set up tracer rounds
- bullet.Force = self.Secondary.Force -- Set the bullet's force
- bullet.Damage = self.Secondary.Damage -- Define how much damage each bullet does
- bullet.AmmoType = self.Secondary.Ammo -- Define what kind of ammo we're using
- self.Owner:FireBullets( bullet ) -- Shoot!
- self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK ) -- View model animation
- self.Owner:MuzzleFlash() -- Crappy muzzle light
- self.Owner:SetAnimation( PLAYER_ATTACK2 ) -- 3rd Person Animation
- self.Weapon:EmitSound(Sound(self.Secondary.Sound)) -- Make shooty noises
- self.Owner:ViewPunch(Angle( -self.Secondary.Recoil, 0, 0 ))
- if (self.Secondary.TakeAmmoPerBullet) then -- Set up ammo loss
- self:TakeSecondaryAmmo(self.Secondary.NumShots)
- else
- self:TakeSecondaryAmmo(1)
- end
- self:SetNextSecondaryFire( CurTime() + self.Secondary.Delay ) -- Don't shoot again until the delay has expired
- end
- function SWEP:Think() -- Called every frame while this weapon is active
- --[[ autoreload code (doesn't work, help?)
- if ( self.AutoReload ) and (( self.LastReload == nil ) or ( CurTime() > (self.LastReload + 1) )) then
- SWEP.LastReload = CurTime()
- if (self:Ammo1() > 0) and (self:Clip1() == 0) and (!self.Weapon:DefaultReload()) then
- self.Weapon:DefaultReload( ACT_VM_RELOAD )
- --self:Reload()
- end
- if (self:Ammo2() > 0) and (self:Clip2() == 0) and (!self.Weapon:DefaultReload()) then
- self.Weapon:DefaultReload( ACT_VM_RELOAD )
- --self:Reload()
- end
- end
- ]]
- end
- function SWEP:Reload() -- Called when we reload
- if (self.Weapon:DefaultReload()) then return end -- If we're already reloading, don't try to reload
- self.Weapon:DefaultReload( ACT_VM_RELOAD ) -- Reload
- self.Weapon:EmitSound(Sound(self.ReloadSound)) -- Make reloady noises
- end
- function SWEP:Deploy() -- Called when we take this weapon out
- self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
- return true
- end
- function SWEP:Holster() -- Called when we put this weapon away
- return true
- end
- function SWEP:OnRemove() -- Called right before this gun exists no more
- end
- function SWEP:OnRestore() -- Called when we load a save where you have this weapon, or if the admin changes the map
- end
- function SWEP:Precache() -- Use this function to precache resources
- end
- function SWEP:OwnerChanged() -- Called when this weapons is dropped or someone else picks it up
- end
- function SWEP:ContextScreenClick( aimvec, mousecode, pressed, ply ) -- Use this function to define what happens when the user clicks with the context screen cursor
- end
Advertisement
Add Comment
Please, Sign In to add comment