CapsAdmin

Untitled

Mar 11th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.42 KB | None | 0 0
  1. easylua.StartWeapon("testpacwep")
  2.  
  3. if CLIENT then
  4.        
  5.     local VIEWMODEL = {
  6.         ["children"] = {
  7.             [1] = {
  8.                 ["children"] = {
  9.                 },
  10.                 ["self"] = {
  11.                     ["ParentName"] = "firstperon",
  12.                     ["ClassName"] = "model",
  13.                     ["Size"] = 0.125,
  14.                     ["UniqueID"] = "3451410124",
  15.                     ["Bone"] = "v weapon lefteft thumb  02",
  16.                     ["Name"] = "barrel firstperson",
  17.                     ["ParentUID"] = "3005904956",
  18.                 },
  19.             },
  20.         },
  21.         ["self"] = {
  22.             ["EditorExpand"] = true,
  23.             ["UniqueID"] = "3005904956",
  24.             ["OwnerName"] = "viewmodel",
  25.             ["Name"] = "firstperon",
  26.             ["ClassName"] = "group",
  27.         },
  28.     }
  29.    
  30.     local WORLDMODEL = {
  31.         ["children"] = {
  32.             [1] = {
  33.                 ["children"] = {
  34.                 },
  35.                 ["self"] = {
  36.                     ["ParentName"] = "my outfit",
  37.                     ["ClassName"] = "model",
  38.                     ["Position"] = Vector(10, -0.60000002384186, -4),
  39.                     ["UniqueID"] = "508789991",
  40.                     ["Size"] = 0.35,
  41.                     ["Bone"] = "right hand",
  42.                     ["Name"] = "barrel thirdperson",
  43.                     ["ParentUID"] = "2950810582",
  44.                 },
  45.             },
  46.         },
  47.         ["self"] = {
  48.             ["EditorExpand"] = true,
  49.             ["UniqueID"] = "2950810582",
  50.             ["ClassName"] = "group",
  51.             ["Name"] = "thirdperson",
  52.             ["Description"] = "add parts to me!",
  53.         },
  54.     }
  55.  
  56.    
  57.     pac.SetupSWEP(SWEP)
  58.    
  59.     net.Receive(SWEP.ClassName, function()
  60.         local ent = net.ReadEntity()
  61.         local event = net.ReadString()
  62.  
  63.         if ent:IsValid() and ent[event] then
  64.             ent[event](ent)
  65.         end
  66.     end)
  67.    
  68.     function SWEP:AttachOutfit()
  69.         self:AttachPACPart(VIEWMODEL)
  70.         self:AttachPACPart(WORLDMODEL)
  71.     end
  72.  
  73.     function SWEP:DetachOutfit()
  74.         self:RemovePACPart(VIEWMODEL)
  75.         self:RemovePACPart(WORLDMODEL)
  76.     end
  77.    
  78.     SWEP.OnRemove = SWEP.DetachOutfit
  79.    
  80.     function SWEP:PrimaryAttack(...)
  81.        
  82.         local barrel = self:FindPACPart(WORLDMODEL, "barrel thirdperson")
  83.        
  84.         self.i = (self.i or 0) + 2
  85.         barrel:SetPositionOffset(Vector(self.i,0,0))
  86.        
  87.         return self.BaseClass.PrimaryAttack(self, ...)
  88.     end
  89. end
  90.  
  91. if SERVER then
  92.     util.AddNetworkString(SWEP.ClassName)
  93.  
  94.     function SWEP:Deploy(...)
  95.         net.Start(self.ClassName)
  96.             net.WriteEntity(self)
  97.             net.WriteString("AttachOutfit")
  98.         net.Broadcast()
  99.  
  100.         return self.BaseClass.Deploy(self, ...)
  101.     end
  102.  
  103.     function SWEP:Holster(...)
  104.         net.Start(self.ClassName)
  105.             net.WriteEntity(self)
  106.             net.WriteString("DetachOutfit")
  107.         net.Broadcast()
  108.        
  109.         return self.BaseClass.Holster(self, ...)
  110.     end
  111.  
  112.     SWEP.OnDrop = SWEP.Holster
  113.     SWEP.OnRemove = SWEP.Holster
  114. end
  115.  
  116. SWEP.PrintName = "P228" -- 'Nice' Weapon name (Shown on HUD)   
  117. SWEP.Slot = 2 -- Slot in the weapon selection menu
  118. SWEP.SlotPos = 3 -- Position in the slot
  119. SWEP.DrawAmmo = true -- Should draw the default HL2 ammo counter                -- Should draw the default crosshair
  120. SWEP.DrawWeaponInfoBox = true -- Should draw the weapon info box
  121. SWEP.BounceWeaponIcon = true -- Should the weapon icon bounce?
  122. --[[cl_init.lua]]
  123. -- Variables that are used on both client and server
  124. SWEP.Category = "guns"
  125. SWEP.MuzzleAttachment = "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
  126. SWEP.ShellEjectAttachment = "2" -- Should be "2" for CSS models or "1" for hl2 models
  127. SWEP.DrawCrosshair = false 
  128.  
  129. SWEP.ViewModelFOV = 65
  130. SWEP.ViewModelFlip = true
  131. SWEP.ViewModel = "models/weapons/v_pist_p228.mdl"
  132. SWEP.WorldModel = "models/weapons/w_pist_p228.mdl"
  133. SWEP.Base = "gdcw_base_pistol"
  134. SWEP.Spawnable = true
  135. SWEP.AdminSpawnable = true
  136.  
  137. SWEP.Primary.Sound = Sound("Weapon_P228.Single")
  138. SWEP.Primary.Round = ("5_7mm")
  139. SWEP.Primary.RPM = 900 -- This is in Rounds Per Minute
  140. SWEP.Primary.ClipSize = 13 -- Size of a clip
  141. SWEP.Primary.DefaultClip = 14
  142. SWEP.Primary.KickUp = 0.4 -- Maximum up recoil (rise)
  143. SWEP.Primary.KickDown = 0.3 -- Maximum down recoil (skeet)
  144. SWEP.Primary.KickHorizontal = 0.3 -- Maximum up recoil (stock)
  145. SWEP.Primary.Automatic = false -- Automatic/Semi Auto
  146. SWEP.Primary.Ammo = "pistol"
  147.  
  148. SWEP.Secondary.ClipSize = 1 -- Size of a clip
  149. SWEP.Secondary.DefaultClip = 1 -- Default number of bullets in a clip
  150. SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
  151. SWEP.Secondary.Ammo = ""
  152. SWEP.Secondary.IronFOV = 50 -- How much you 'zoom' in. Less is more!    
  153.  
  154. SWEP.data = {} -- The starting firemode
  155. SWEP.data.ironsights = 1
  156.  
  157.  
  158. SWEP.IronSightsPos = Vector (4.7715, 0, 2.9797)
  159. SWEP.IronSightsAng = Vector (-0.6263, 0.0401, 0)
  160. SWEP.SightsPos = Vector (4.7715, 0, 2.9797)
  161. SWEP.SightsAng = Vector (-0.6263, 0.0401, 0)
  162. SWEP.RunSightsPos = Vector (1.6926, 0, 3.6188)
  163. SWEP.RunSightsAng = Vector (-21.0418, -0.1143, 0)
  164.  
  165. easylua.EndWeapon(true)
Advertisement
Add Comment
Please, Sign In to add comment