как добавить прицелв свой swep так, чтобы при нажатии правой кнопки fow уменьшывался и по средине появлялся прицел структура : --------------------------------------------------------------------------------- -------------------------------| --Buzzofwar-- Please do not steal or copy this! I put much effort and time into perfecting it to make it simple| --------------------------------------------------------------------------------- -------------------------------| //General Settings \\ SWEP.AdminSpawnable = true -- Is the swep spawnable for admin. SWEP.ViewModelFOV = 65 -- How much of the weapon do u see. SWEP.ViewModel = "models/weapons/Payday2/v_rif_famas2.mdl" -- The viewModel, the model you se when you are holding it. SWEP.WorldModel = "models/weapons/w_smg_tmp.mdl" -- The worlmodel, The model yu when it's down on the ground. SWEP.ViewModelFlip = true -- If the model should be fliped when you see it. SWEP.UseHands = false -- Weather the player model should use its hands. SWEP.AutoSwitchTo = true -- when someone walks over the swep, chould i automatectly change to your swep. SWEP.Slot = 1 -- Deside wich slot you want your swep do be in. SWEP.HoldType = "ar2" -- How the swep is hold Pistol smg greanade melee. SWEP.PrintName = "Para" -- your sweps name. SWEP.Author = "Buzzofwar" -- Your name. SWEP.Spawnable = true -- Can everybody spawn this swep. SWEP.AutoSwitchFrom = false -- Does the weapon get changed by other sweps if you pick them up. SWEP.FiresUnderwater = true -- Does your swep fire under water. SWEP.Weight = 4 -- Chose the weight of the Swep. SWEP.DrawCrosshair = true -- Do you want it to have a crosshair. SWEP.Category = "Payday 2 Sweps" -- Make your own catogory for the swep. SWEP.SlotPos = 1 -- Deside wich slot you want your swep do be in. SWEP.DrawAmmo = true -- Does the ammo show up when you are using it. SWEP.ReloadSound = "" -- Reload sound. SWEP.Instructions = "" -- How do pepole use your swep. SWEP.Contact = "Buzzofawr" -- How Pepole chould contact you. SWEP.Purpose = "" -- What is the purpose with this. SWEP.base = "swep_ironsight_base" -- What base should the swep be based on. SWEP.SwayScale = .1 SWEP.BobScale = .1 //General settings\\ --------------------------------------------------------------------------------|
function SWEP:Initialize() self:SetWeaponHoldType( self.HoldType ) end --------------------------------------------------------------------------------|
function SWEP:Precache() util.PrecacheSound("") end --------------------------------------------------------------------------------|
function SWEP:Think() end --------------------------------------------------------------------------------|
function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end local tr = self.Owner:GetEyeTrace(); if ( self.Primary.BulletShot ) then local bullet = {}
bullet.Num = self.Primary.NumberofShots //The number of shots fired bullet.Src = self.Owner:GetShootPos() //Gets where the bullet comes from bullet.Dir = self.Owner:GetAimVector() //Gets where you're aiming bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0) bullet.Tracer = 1 bullet.Force = self.Primary.Force bullet.Damage = self.Primary.Damage bullet.AmmoType = self.Primary.Ammo self.Owner:FireBullets( bullet ); end
function SWEP:Deploy() self.Weapon:SendWeaponAnim(ACT_VM_DRAW); self.Weapon:EmitSound "pay/Para Foley.wav" timer.Simple(.2 ,function() self.Weapon:EmitSound("pay/Para Pull.wav" ) end) return true end --------------------------------------------------------------------------------|
function SWEP:Holster() self.Weapon:EmitSound "pay/Para Foley.wav" return true end --------------------------------------------------------------------------------|
function SWEP:Reload() self:SetNextPrimaryFire( CurTime() + 1.8) if ( self.Weapon:GetNetworkedBool( "reloading", false ) ) then return end if ( self.Weapon:Clip1() < self.Primary.ClipSize && self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then self.Weapon:SetNetworkedBool( "reloading", true ) self.Weapon:SetVar( "reloadtimer", CurTime() + 0.6 ) self.Weapon:SendWeaponAnim(ACT_VM_RELOAD) end end --------------------------------------------------------------------------------|
local Time = CurTime() --------------------------------------------------------------------------------|
function SWEP:Reload() if ( self.Weapon:Ammo1() <= 0 ) then return end if ( self.Weapon:Clip1() >= self.Primary.ClipSize ) then return end if (CurTime() < Time + 0.5) then return end Time = CurTime()
self.Owner:SetAnimation(PLAYER_RELOAD) self.Weapon:DefaultReload(ACT_VM_RELOAD) end --------------------------------------------------------------------------------- -------------------------------|