Ergebnis 1 bis 2 von 2

Thema: we

  1. #1

    Standard we

    Lua Code:
    1. if (SERVER) then
    2. 	AddCSLuaFile( "shared.lua" )
    3. 	SWEP.Weight				= 5
    4. 	SWEP.AutoSwitchTo		= true
    5. 	SWEP.AutoSwitchFrom		= true
    6. end
    7.  
    8. if (CLIENT) then
    9. 	SWEP.DrawAmmo			= true
    10. 	SWEP.DrawCrosshair		= false
    11. 	SWEP.ViewModelFOV		= 82
    12. 	SWEP.ViewModelFlip		= true
    13. 	SWEP.CSMuzzleFlashes	= true
    14.  
    15. 	SWEP.ViewModelFlip		= false
    16.  
    17. 	surface.CreateFont( "" )
    18. 	surface.CreateFont( "" )
    19. end
    20.  
    21. if ( CLIENT ) then
    22. 	SWEP.Author			= "[JEM]TheReignOfTheDesserted"
    23. 	SWEP.Contact			= "[email protected]"
    24. 	SWEP.Purpose			= "I will the world mayy cry!"
    25. 	SWEP.Instructions		= "Left klick to Throw"
    26. 	SWEP.PrintName			= "FusionFrenade"
    27. 	SWEP.Slot			= 3
    28. 	SWEP.SlotPos			= 2
    29. 	SWEP.IconLetter			= "O"
    30.  
    31. 	SWEP.ViewModelFlip		= true
    32.  
    33. 	killicon.AddFont()
    34. end
    35.  
    36. SWEP.Spawnable			= true
    37. SWEP.AdminSpawnable		= false
    38.  
    39. SWEP.ViewModel			= "models/weapons/v_gravball.mdl"
    40. SWEP.WorldModel			= "models/weapons/w_gravball.mdl"
    41. SWEP.HoldType			= "grenade"
    42.  
    43. SWEP.Primary.Sound		= Sound("Default.PullPin_Grenade")
    44. SWEP.Primary.Recoil		= 0
    45. SWEP.Primary.Unrecoil		= 0
    46. SWEP.Primary.Damage		= 0
    47. SWEP.Primary.NumShots		= 1
    48. SWEP.Primary.Cone		= 0
    49. SWEP.Primary.Delay		= 1
    50.  
    51. SWEP.Primary.ClipSize		= 10
    52. SWEP.Primary.DefaultClip	= 10000
    53. SWEP.Primary.Automatic		= false
    54. SWEP.Primary.Ammo		= "grenade"
    55.  
    56. SWEP.Secondary.ClipSize		= -1
    57. SWEP.Secondary.DefaultClip	= -1
    58. SWEP.Secondary.Automatic	= false
    59. SWEP.Secondary.Ammo		= "none"
    60.  
    61. SWEP.Next = CurTime()
    62. SWEP.Primed = 0
    63.  
    64. function SWEP:Reload()
    65. 	return false
    66. end
    67.  
    68. function SWEP:Deploy()
    69. 	return true
    70. end
    71.  
    72. function SWEP:Holster()
    73. 	self.Next = CurTime()
    74. 	self.Primed = 0
    75. 	return true
    76. end
    77.  
    78. function SWEP:ShootEffects()
    79. 	self.Weapon:SendWeaponAnim( ACT_VM_THROW ) 		// View model animation
    80. 	//self.Owner:MuzzleFlash()								// Crappy muzzle light
    81. 	self.Owner:SetAnimation( PLAYER_ATTACK1 )				// 3rd Person Animation
    82. end
    83.  
    84.  
    85. function SWEP:PrimaryAttack()
    86.  
    87. if ( !self:CanPrimaryAttack() ) then return end
    88.  
    89. 			self:TakePrimaryAmmo( 1 )
    90.  
    91. 			self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
    92.  
    93. 			self.Owner:SetAnimation( PLAYER_ATTACK1 )
    94.  
    95. 			self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
    96.  
    97. 			self.Weapon:EmitSound( self.Primary.Sound, 100, 100 )
    98.  
    99. 		self.Owner:ViewPunch(Vector(math.Rand(-1,1),math.Rand(-1,1),math.Rand(-9,-4))) --soft viewpunch
    100.  
    101. 				if (!CLIENT) then
    102.  
    103. 					local Ang = self.Owner:EyeAngles()
    104.  
    105. 					Ang.pitch = Ang.pitch - 5
    106.  
    107. 					self.Owner:SetEyeAngles( Ang ) --rough viewpunch
    108.  
    109. 				end
    110.  
    111. 		local trace={}
    112. 		trace.start=self.Owner:GetShootPos()
    113. 		trace.endpos=self.Owner:GetShootPos()+self.Owner:GetForward()*2000000000
    114. 		trace.filter=self.Owner
    115. 		local tracer = util.TraceLine( trace )
    116.  
    117. 		if tracer.Hit then
    118. 			local effect = EffectData()
    119. 			effect:SetEntity( self.Owner )
    120. 			effect:SetStart( self.Owner:GetShootPos() + self.Owner:GetRight())
    121. 			effect:SetAttachment( 1 )
    122. 			effect:SetOrigin( tracer.HitPos )
    123. 			effect:SetScale( 1.0 )
    124. 			effect:SetMagnitude( 3000 )
    125. 			util.Effect( "FBG-Beam", effect )
    126.  
    127. 		local damage = ents.Create("point_hurt")
    128. 		damage:SetKeyValue("DamageRadius", 3000)
    129. 		damage:SetKeyValue("Damage" , 1000)
    130. 		damage:SetKeyValue("DamageDelay", 3)
    131. 		damage:SetKeyValue("DamageType" ,"67108864")
    132. 		damage:SetPos(tracer.HitPos)
    133. 		damage:Fire("TurnOn" , "", 0)
    134. 		damage:Fire("TurnOff" , "", 2)
    135. 		damage:Fire("kill","", 2)
    136.  
    137. 		local fx = EffectData()
    138. 		fx:SetOrigin(tracer.HitPos)
    139. 		fx:SetScale(0.5)
    140. 		util.Effect( "HelicopterMegaBomb", fx )
    141. 		local fx2 = EffectData()
    142. 		fx2:SetOrigin(tracer.HitPos)
    143. 		fx2:SetScale(0.1)
    144. 		util.Effect( "FBG-Explosion", fx2 )
    145.  
    146. 		util.BlastDamage(self.Owner,self.Owner,tracer.HitPos,128,self.Primary.Damage)
    147. 		local trace2={}
    148. 		trace2.start=tracer.HitPos + self.Owner:GetAimVector()*32
    149. 		trace2.endpos=tracer.HitPos + self.Owner:GetAimVector()*2000000000
    150. 		trace2.filter=trace.Entity
    151. 		local tracer2 = util.TraceLine( trace2 )
    152. 		util.BlastDamage(self.Owner,self.Owner,tracer2.HitPos,64,self.Primary.Damage)
    153. 		if tracer2.Hit then
    154. 		local fx3 = EffectData()
    155. 		fx3:SetOrigin(tracer2.HitPos)
    156. 		fx3:SetScale(0.5)
    157. 		util.Effect( "HelicopterMegaBomb", fx3 )
    158. 		local fx4 = EffectData()
    159. 		fx4:SetOrigin(tracer2.HitPos)
    160. 		fx4:SetScale(0.1)
    161. 		util.Effect( "FBG-Explosion", fx4 )
    162.  
    163. 		local trace3={}
    164. 		trace3.start=tracer2.HitPos + self.Owner:GetAimVector()*32
    165. 		trace3.endpos=tracer2.HitPos + self.Owner:GetAimVector()*2000000000
    166. 		trace3.filter=tracer2.Entity
    167. 		local tracer3 = util.TraceLine( trace3 )
    168. 		util.BlastDamage(self.Owner,self.Owner,tracer3.HitPos,64,self.Primary.Damage)
    169. 		if tracer3.Hit then
    170. 		local fx6 = EffectData()
    171. 		fx6:SetOrigin(tracer3.HitPos)
    172. 		fx6:SetScale(0.5)
    173. 		util.Effect( "HelicopterMegaBomb", fx6 )
    174. 		local fx7 = EffectData()
    175. 		fx7:SetOrigin(tracer3.HitPos)
    176. 		fx7:SetScale(0.1)
    177. 		util.Effect( "FBG-Explosion", fx7 )
    178.  
    179. 		local trace4={}
    180. 		trace4.start=tracer3.HitPos + self.Owner:GetAimVector()*32
    181. 		trace4.endpos=tracer3.HitPos + self.Owner:GetAimVector()*2000000000
    182. 		trace4.filter=tracer3.Entity
    183. 		local tracer4 = util.TraceLine( trace4 )
    184. 		if tracer4.Hit then
    185. 		util.BlastDamage(self.Owner,self.Owner,tracer4.HitPos,64,self.Primary.Damage)
    186.  
    187. 		local fx8 = EffectData()
    188. 		fx8:SetOrigin(tracer4.HitPos)
    189. 		fx8:SetScale(0.5)
    190. 		util.Effect( "HelicopterMegaBomb", fx8 )
    191. 		local fx9 = EffectData()
    192. 		fx9:SetOrigin(tracer4.HitPos)
    193. 		fx9:SetScale(0.1)
    194. 		util.Effect( "FBG-Explosion", fx9 )
    195.  
    196. 		local trace5={}
    197. 		trace5.start=tracer4.HitPos + self.Owner:GetAimVector()*32
    198. 		trace5.endpos=tracer4.HitPos + self.Owner:GetAimVector()*2000000000
    199. 		trace5.filter=tracer4.Entity
    200. 		local tracer5 = util.TraceLine( trace5 )
    201. 		if tracer5.Hit then
    202. 		util.BlastDamage(self.Owner,self.Owner,tracer5.HitPos,64,self.Primary.Damage)
    203.  
    204. 		local fx10 = EffectData()
    205. 		fx10:SetOrigin(tracer5.HitPos)
    206. 		fx10:SetScale(0.5)
    207. 		util.Effect( "HelicopterMegaBomb", fx10 )
    208. 		local fx11 = EffectData()
    209. 		fx11:SetOrigin(tracer5.HitPos)
    210. 		fx11:SetScale(0.1)
    211. 		util.Effect( "FBG-Explosion", fx11 )
    212.  
    213. 					end
    214. 				end
    215. 			end
    216. 		end
    217. 	end
    218. end
    219.  
    220. function SWEP:PrintWeaponInfo( x, y, alpha )
    221. 	//if ( self.DrawWeaponInfoBox == false ) then return end
    222.  
    223. 	if (self.InfoMarkup == nil ) then
    224. 		local str
    225. 		local title_color = "<color=230,230,230,255>"
    226. 		local text_color = "<color=150,150,150,255>"
    227.  
    228. 		str = "<font=HudSelectionText>"
    229. 		if ( self.Author != "" ) then str = str .. title_color .. "Author:</color>\t"..text_color..self.Author.."</color>\n" end
    230. 		if ( self.Contact != "" ) then str = str .. title_color .. "Contact:</color>\t"..text_color..self.Contact.."</color>\n\n" end
    231. 		if ( self.Purpose != "" ) then str = str .. title_color .. "Purpose:</color>\n"..text_color..self.Purpose.."</color>\n\n" end
    232. 		if ( self.Instructions != "" ) then str = str .. title_color .. "Instructions:</color>\n"..text_color..self.Instructions.."</color>\n" end
    233. 		str = str .. "</font>"
    234.  
    235. 		self.InfoMarkup = markup.Parse( str, 250 )
    236. 	end
    237.  
    238. 	surface.SetDrawColor( 60, 60, 60, alpha )
    239. 	surface.SetTexture( self.SpeechBubbleLid )
    240.  
    241. 	surface.DrawTexturedRect( x, y - 64 - 5, 128, 64 ) 
    242. 	draw.RoundedBox( 8, x - 5, y - 6, 260, self.InfoMarkup:GetHeight() + 18, Color( 60, 60, 60, alpha ) )
    243.  
    244. 	self.InfoMarkup:Draw( x+5, y+5, nil, nil, alpha )
    245.  
    246. end
    247.  
    248. function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
    249.  
    250. 	draw.SimpleText( self.IconLetter, "CSSelectIcons", x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER )
    251.  
    252. 	// try to fool them into thinking they're playing a Tony Hawks game
    253. 	//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 )
    254. 	//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 )
    255.  
    256. 	self:PrintWeaponInfo( x + wide + 20, y + tall * 0.95, alpha )
    257.  
    258.         end
    259.  
    260. end

  2. #2

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •