PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : we



RP-01
22.06.2008, 17:25
if (SERVER) then
AddCSLuaFile( "shared.lua" )
SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true
end

if (CLIENT) then
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = false
SWEP.ViewModelFOV = 82
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = true

SWEP.ViewModelFlip = false

surface.CreateFont( "" )
surface.CreateFont( "" )
end

if ( CLIENT ) then
SWEP.Author = "[JEM]TheReignOfTheDesserted"
SWEP.Contact = "[email protected]"
SWEP.Purpose = "I will the world mayy cry!"
SWEP.Instructions = "Left klick to Throw"
SWEP.PrintName = "FusionFrenade"
SWEP.Slot = 3
SWEP.SlotPos = 2
SWEP.IconLetter = "O"

SWEP.ViewModelFlip = true

killicon.AddFont()
end

SWEP.Spawnable = true
SWEP.AdminSpawnable = false

SWEP.ViewModel = "models/weapons/v_gravball.mdl"
SWEP.WorldModel = "models/weapons/w_gravball.mdl"
SWEP.HoldType = "grenade"

SWEP.Primary.Sound = Sound("Default.PullPin_Grenade")
SWEP.Primary.Recoil = 0
SWEP.Primary.Unrecoil = 0
SWEP.Primary.Damage = 0
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0
SWEP.Primary.Delay = 1

SWEP.Primary.ClipSize = 10
SWEP.Primary.DefaultClip = 10000
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "grenade"

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

SWEP.Next = CurTime()
SWEP.Primed = 0

function SWEP:Reload()
return false
end

function SWEP:Deploy()
return true
end

function SWEP:Holster()
self.Next = CurTime()
self.Primed = 0
return true
end

function SWEP:ShootEffects()
self.Weapon:SendWeaponAnim( ACT_VM_THROW ) // View model animation
//self.Owner:MuzzleFlash() // Crappy muzzle light
self.Owner:SetAnimation( PLAYER_ATTACK1 ) // 3rd Person Animation
end


function SWEP:PrimaryAttack()

if ( !self:CanPrimaryAttack() ) then return end

self:TakePrimaryAmmo( 1 )

self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )

self.Owner:SetAnimation( PLAYER_ATTACK1 )

self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )

self.Weapon:EmitSound( self.Primary.Sound, 100, 100 )

self.Owner:ViewPunch(Vector(math.Rand(-1,1),math.Rand(-1,1),math.Rand(-9,-4))) --soft viewpunch

if (!CLIENT) then

local Ang = self.Owner:EyeAngles()

Ang.pitch = Ang.pitch - 5

self.Owner:SetEyeAngles( Ang ) --rough viewpunch

end

local trace={}
trace.start=self.Owner:GetShootPos()
trace.endpos=self.Owner:GetShootPos()+self.Owner:G etForward()*2000000000
trace.filter=self.Owner
local tracer = util.TraceLine( trace )

if tracer.Hit then
local effect = EffectData()
effect:SetEntity( self.Owner )
effect:SetStart( self.Owner:GetShootPos() + self.Owner:GetRight())
effect:SetAttachment( 1 )
effect:SetOrigin( tracer.HitPos )
effect:SetScale( 1.0 )
effect:SetMagnitude( 3000 )
util.Effect( "FBG-Beam", effect )

local damage = ents.Create("point_hurt")
damage:SetKeyValue("DamageRadius", 3000)
damage:SetKeyValue("Damage" , 1000)
damage:SetKeyValue("DamageDelay", 3)
damage:SetKeyValue("DamageType" ,"67108864")
damage:SetPos(tracer.HitPos)
damage:Fire("TurnOn" , "", 0)
damage:Fire("TurnOff" , "", 2)
damage:Fire("kill","", 2)

local fx = EffectData()
fx:SetOrigin(tracer.HitPos)
fx:SetScale(0.5)
util.Effect( "HelicopterMegaBomb", fx )
local fx2 = EffectData()
fx2:SetOrigin(tracer.HitPos)
fx2:SetScale(0.1)
util.Effect( "FBG-Explosion", fx2 )

util.BlastDamage(self.Owner,self.Owner,tracer.HitP os,128,self.Primary.Damage)
local trace2={}
trace2.start=tracer.HitPos + self.Owner:GetAimVector()*32
trace2.endpos=tracer.HitPos + self.Owner:GetAimVector()*2000000000
trace2.filter=trace.Entity
local tracer2 = util.TraceLine( trace2 )
util.BlastDamage(self.Owner,self.Owner,tracer2.Hit Pos,64,self.Primary.Damage)
if tracer2.Hit then
local fx3 = EffectData()
fx3:SetOrigin(tracer2.HitPos)
fx3:SetScale(0.5)
util.Effect( "HelicopterMegaBomb", fx3 )
local fx4 = EffectData()
fx4:SetOrigin(tracer2.HitPos)
fx4:SetScale(0.1)
util.Effect( "FBG-Explosion", fx4 )

local trace3={}
trace3.start=tracer2.HitPos + self.Owner:GetAimVector()*32
trace3.endpos=tracer2.HitPos + self.Owner:GetAimVector()*2000000000
trace3.filter=tracer2.Entity
local tracer3 = util.TraceLine( trace3 )
util.BlastDamage(self.Owner,self.Owner,tracer3.Hit Pos,64,self.Primary.Damage)
if tracer3.Hit then
local fx6 = EffectData()
fx6:SetOrigin(tracer3.HitPos)
fx6:SetScale(0.5)
util.Effect( "HelicopterMegaBomb", fx6 )
local fx7 = EffectData()
fx7:SetOrigin(tracer3.HitPos)
fx7:SetScale(0.1)
util.Effect( "FBG-Explosion", fx7 )

local trace4={}
trace4.start=tracer3.HitPos + self.Owner:GetAimVector()*32
trace4.endpos=tracer3.HitPos + self.Owner:GetAimVector()*2000000000
trace4.filter=tracer3.Entity
local tracer4 = util.TraceLine( trace4 )
if tracer4.Hit then
util.BlastDamage(self.Owner,self.Owner,tracer4.Hit Pos,64,self.Primary.Damage)

local fx8 = EffectData()
fx8:SetOrigin(tracer4.HitPos)
fx8:SetScale(0.5)
util.Effect( "HelicopterMegaBomb", fx8 )
local fx9 = EffectData()
fx9:SetOrigin(tracer4.HitPos)
fx9:SetScale(0.1)
util.Effect( "FBG-Explosion", fx9 )

local trace5={}
trace5.start=tracer4.HitPos + self.Owner:GetAimVector()*32
trace5.endpos=tracer4.HitPos + self.Owner:GetAimVector()*2000000000
trace5.filter=tracer4.Entity
local tracer5 = util.TraceLine( trace5 )
if tracer5.Hit then
util.BlastDamage(self.Owner,self.Owner,tracer5.Hit Pos,64,self.Primary.Damage)

local fx10 = EffectData()
fx10:SetOrigin(tracer5.HitPos)
fx10:SetScale(0.5)
util.Effect( "HelicopterMegaBomb", fx10 )
local fx11 = EffectData()
fx11:SetOrigin(tracer5.HitPos)
fx11:SetScale(0.1)
util.Effect( "FBG-Explosion", fx11 )

end
end
end
end
end
end

function SWEP:PrintWeaponInfo( x, y, alpha )
//if ( self.DrawWeaponInfoBox == false ) then return end

if (self.InfoMarkup == nil ) then
local str
local title_color = "<color=230,230,230,255>"
local text_color = "<color=150,150,150,255>"

str = "<font=HudSelectionText>"
if ( self.Author != "" ) then str = str .. title_color .. "Author:</color>\t"..text_color..self.Author.."</color>\n" end
if ( self.Contact != "" ) then str = str .. title_color .. "Contact:</color>\t"..text_color..self.Contact.."</color>\n\n" end
if ( self.Purpose != "" ) then str = str .. title_color .. "Purpose:</color>\n"..text_color..self.Purpose.."</color>\n\n" end
if ( self.Instructions != "" ) then str = str .. title_color .. "Instructions:</color>\n"..text_color..self.Instructions.."</color>\n" end
str = str .. "</font>"

self.InfoMarkup = markup.Parse( str, 250 )
end

surface.SetDrawColor( 60, 60, 60, alpha )
surface.SetTexture( self.SpeechBubbleLid )

surface.DrawTexturedRect( x, y - 64 - 5, 128, 64 )
draw.RoundedBox( 8, x - 5, y - 6, 260, self.InfoMarkup:GetHeight() + 18, Color( 60, 60, 60, alpha ) )

self.InfoMarkup:Draw( x+5, y+5, nil, nil, alpha )

end

function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )

draw.SimpleText( self.IconLetter, "CSSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER )

// try to fool them into thinking they're playing a Tony Hawks game
//draw.SimpleText( self.IconLetter, "CSSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-14, 14), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER )
//draw.SimpleText( self.IconLetter, "CSSelectIcons", x + wide/2 + math.Rand(-4, 4), y + tall*0.2+ math.Rand(-9, 9), Color( 255, 210, 0, math.Rand(10, 120) ), TEXT_ALIGN_CENTER )

self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )

end

end

Pac_187
22.06.2008, 17:29
:shock: