add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,306 @@
-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------
AddCSLuaFile()
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.AmmoHere",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_ammohere.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_ammohere_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.OutOfAmmo",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_outofammo.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_outofammo_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.RequestAmmo",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/PLAYER_REQUEST_TM_requestammo.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/PLAYER_REQUEST_TM_requestammo_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Ammokit.Pickup",
["channel"] = CHAN_ITEM ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = "v92/bf2/common/pick_up_ammopack.mp3"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Ammokit.Deploy" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 },
["sound"] = "v92/bf2/weapons/handheld/ammokit/medikit_deploy.wav"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Ammokit.Holster" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 } ,
["sound"] = "v92/bf2/weapons/handheld/ammokit/medikit_deploy.wav"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Ammokit.Throw" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 } ,
["sound"] = "v92/bf2/weapons/handheld/ammokit/throw.wav"
})
if CLIENT then
local strEntityName = "v92_bf2_ammokit"
local strInfoName = "Ammo Kit"
SWEP.Category = "Utilities"
SWEP.PrintName = strInfoName
SWEP.Author = "V92"
SWEP.Contact = "Steam"
SWEP.Purpose = "Resupplying Nearby Units"
SWEP.Instructions = "Primary: Supply Target\nSecondary: Throw Consumable Kit\nUSE+Secondary: Drop Consumable Kit"
SWEP.Slot = 4
SWEP.SlotPos = 32
SWEP.WepSelectIcon = surface.GetTextureID("vgui/hud/" .. strEntityName )
SWEP.ViewModelFOV = 67
SWEP.BounceWeaponIcon = false
language.Add( strEntityName, strInfoName )
killicon.Add( strEntityName, "vgui/entities/".. strEntityName , Color( 255, 255, 255 ) )
end
SWEP.Weight = 1
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.UseHands = true
SWEP.ViewModel = Model("models/v92/bf2/weapons/handheld/ammokit_c.mdl")
SWEP.WorldModel = Model("models/v92/bf2/weapons/handheld/ammokit_w.mdl")
SWEP.Primary.ClipSize = 100
SWEP.Primary.DefaultClip = 100
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "None"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "None"
SWEP.SupplyAmount = 25
SWEP.MaxAmmo = 100 -- Maximum ammo
local ThrowSound = Sound( "BF2.Weapon.Handheld.Ammokit.Throw" )
local SupplySound = Sound( "BF2.Weapon.Handheld.Ammokit.Pickup" )
local AmmoSoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.AmmoHere" )
local EmptySoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.OutOfAmmo" )
local RequestSoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.RequestAmmo" )
local DeployEntity = "v92_bf2_ammokit_ent"
function SWEP:Initialize()
self:SetHoldType( "slam" )
self.SupplyAmount = self.SupplyAmount or 25
if CLIENT then
return
end
timer.Create( "ammokit_ammo" .. self:EntIndex() , 5 , 0 , function()
if ( self:Clip1() < self.MaxAmmo ) then self:SetClip1( math.min( self:Clip1() + 5 , self.MaxAmmo ) ) end
end )
end
function SWEP:PrimaryAttack()
if CLIENT then
return
end
if self.Owner:IsPlayer() then
self.Owner:LagCompensation( true )
end
local tr = util.TraceLine( {
["start"] = self.Owner:GetShootPos(),
["endpos"] = self.Owner:GetShootPos() + self.Owner:GetAimVector() * 64,
["filter"] = self.Owner
} )
if self.Owner:IsPlayer() then
self.Owner:LagCompensation( false )
end
local ent = tr.Entity
local need = 25
if IsValid( ent ) and self:Clip1() >= need then
self:TakePrimaryAmmo( need )
local cw = ent:GetActiveWeapon()
if not IsValid(cw) then
self.Owner:EmitSound( EmptySoundVO )
self:SetNextSecondaryFire( CurTime() + 3 )
return
end
local ammoType = cw:GetPrimaryAmmoType()
if ammoType == "rpg_round" or ammoType == "PanzerFaust3 Rocket" then
-- Не давать патроны для ракетниц
self.Owner:EmitSound( EmptySoundVO )
self:SetNextSecondaryFire( CurTime() + 3 )
return
end
ent:GiveAmmo( cw:GetMaxClip1() , ammoType , false )
ent:EmitSound( SupplySound )
if ent == tr.Entity then
self.Owner:EmitSound( AmmoSoundVO )
end
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
self:SetNextPrimaryFire( CurTime() + self:SequenceDuration() + 1 )
self.Owner:SetAnimation( PLAYER_ATTACK1 )
-- Even though the viewmodel has looping IDLE anim at all times, we need this to make fire animation work in multiplayer
-- timer.Create( "weapon_idle" .. self:EntIndex(), self:SequenceDuration(), 1, function() if ( IsValid( self ) ) then self:SendWeaponAnim( ACT_VM_IDLE ) end end )
else
self.Owner:EmitSound( EmptySoundVO )
self:SetNextSecondaryFire( CurTime() + 3 )
end
end
function SWEP:SecondaryAttack()
if CLIENT then
return
end
local ent = self.Owner
local need = 25
if IsValid( ent ) and self:Clip1() >= need then
self:TakePrimaryAmmo( need )
ent:EmitSound( AmmoSoundVO )
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
local deployEnt = ents.Create( DeployEntity )
deployEnt:SetPos( ent:EyePos() + ent:GetAimVector() * 16 + ent:GetRight() * 2 + ent:GetUp() * -3 )
deployEnt:SetAngles( ent:EyeAngles() - Angle( 45 , 0 , 0 ) )
deployEnt:SetOwner( self.Owner )
deployEnt:Spawn()
if deployEnt:GetPhysicsObject():IsValid() then
deployEnt:GetPhysicsObject():SetMass( 5 )
if self.Owner:KeyDown( IN_USE ) then
deployEnt:GetPhysicsObject():SetVelocity( ent:GetAimVector() * 50 )
else
deployEnt:GetPhysicsObject():SetVelocity( ent:GetAimVector() * 400 )
end
end
self:SetNextSecondaryFire( CurTime() + self:SequenceDuration() + 1 )
self.Owner:SetAnimation( PLAYER_ATTACK1 )
-- timer.Create( "weapon_idle" .. self:EntIndex(), self:SequenceDuration(), 1, function() if ( IsValid( self ) ) then self:SendWeaponAnim( ACT_VM_IDLE ) end end )
else
self.Owner:EmitSound( EmptySoundVO )
self:SetNextSecondaryFire( CurTime() + 3 )
end
end
function SWEP:OnRemove()
timer.Stop( "ammokit_ammo" .. self:EntIndex() )
-- timer.Stop( "weapon_idle" .. self:EntIndex() )
end
function SWEP:Holster()
-- timer.Stop( "weapon_idle" .. self:EntIndex() )
return true
end
function SWEP:CustomAmmoDisplay()
self.AmmoDisplay = self.AmmoDisplay or {}
self.AmmoDisplay.Draw = true -- draw the display?
if self.Primary.ClipSize > 0 then
self.AmmoDisplay.PrimaryClip = self:Clip1() -- amount in clip
self.AmmoDisplay.PrimaryAmmo = self:Ammo1() -- amount in reserve
end
if self.Secondary.ClipSize > 0 then
self.AmmoDisplay.SecondaryAmmo = self:Ammo2() -- amount of secondary ammo
end
return self.AmmoDisplay -- return the table
end
-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------

View File

@@ -0,0 +1,233 @@
-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------
AddCSLuaFile()
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.HealHere",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_healhere.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_healhere_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.OutOfMedic",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_outofmedic.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/auto_moodgp_tm_outofmedic_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.VO.English.Grunt.NoFilter.RequestMedic",
["channel"] = CHAN_VOICE ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = {
"v92/bf2/vo/english/grunt/no_filter/PLAYER_REQUEST_TM_requestmedic.ogg" ,
"v92/bf2/vo/english/grunt/no_filter/PLAYER_REQUEST_TM_requestmedic_alt.ogg"
}
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Medikit.Pickup",
["channel"] = CHAN_ITEM ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = 100 ,
["sound"] = "v92/bf2/common/pick_up_medipack.wav"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Medikit.Deploy" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 },
["sound"] = "v92/bf2/weapons/handheld/medikit/medikit_deploy.wav"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Medikit.Holster" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 } ,
["sound"] = "v92/bf2/weapons/handheld/medikit/medikit_deploy.wav"
})
sound.Add({ ["name"] = "BF2.Weapon.Handheld.Medikit.Throw" ,
["channel"] = CHAN_BODY ,
["volume"] = 1.0 ,
["level"] = 85 ,
["pitch"] = { 95 , 105 } ,
["sound"] = "v92/bf2/weapons/handheld/medikit/throw.wav"
})
if CLIENT then
local strEntityName = "v92_bf2_medikit"
local strInfoName = "Medical Kit"
SWEP.Category = "Utilities"
SWEP.PrintName = strInfoName
SWEP.Author = "V92"
SWEP.Contact = "Steam"
SWEP.Purpose = "Healing Nearby Units"
SWEP.Instructions = "Primary: Надеть/снять аптечку на себя\nUse+Primary: Вылечить себя\n"
SWEP.Slot = 4
SWEP.SlotPos = 32
SWEP.WepSelectIcon = surface.GetTextureID("vgui/hud/" .. strEntityName )
SWEP.ViewModelFOV = 67
SWEP.BounceWeaponIcon = false
language.Add( strEntityName, strInfoName )
killicon.Add( strEntityName, "vgui/entities/".. strEntityName , Color( 255, 255, 255 ) )
end
SWEP.Weight = 1
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.UseHands = true
SWEP.ViewModel = Model("models/v92/bf2/weapons/handheld/medikit_c.mdl")
SWEP.WorldModel = Model("models/v92/bf2/weapons/handheld/medikit_w.mdl")
SWEP.Primary.ClipSize = 100
SWEP.Primary.DefaultClip = 100
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.HealAmount = GetConVarNumber("sk_healthkit")
SWEP.MaxAmmo = 100
local ThrowSound = Sound( "BF2.Weapon.Handheld.Medikit.Throw" )
local HealSound = Sound( "BF2.Weapon.Handheld.Medikit.Pickup" )
local HealSoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.HealHere" )
local EmptySoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.OutOfMedic" )
local RequestSoundVO = Sound( "BF2.VO.English.Grunt.NoFilter.RequestMedic" )
function SWEP:Initialize()
self:SetHoldType( "slam" )
self.HealAmount = GetConVarNumber("sk_healthkit")
if CLIENT then
return
end
timer.Create( "medkit_ammo" .. self:EntIndex() , 10 , 0 , function()
if ( self:Clip1() < self.MaxAmmo ) then
self:SetClip1( math.min( self:Clip1() + 5 , self.MaxAmmo ) )
end
end )
end
function SWEP:PrimaryAttack()
if CLIENT then return end
local owner = self.Owner
if not IsValid(owner) then return end
local medikitOnBack = nil
for _, ent in ipairs(ents.FindByClass("v92_bf2_medikit_ent")) do
if IsValid(ent) and ent.IsAttached and ent.AttachedPlayer == owner then
medikitOnBack = ent
break
end
end
if medikitOnBack then
if owner:KeyDown(IN_USE) then
owner:ChatPrint("[!] Нельзя лечить себя, пока аптечка на спине!")
self:SetNextPrimaryFire(CurTime() + 0.5)
return
end
medikitOnBack:DetachFromPlayer()
self:SetNextPrimaryFire(CurTime() + 1)
return
end
if owner:KeyDown(IN_USE) then
local need = GetConVarNumber("sk_healthkit")
need = math.min(owner:GetMaxHealth() - owner:Health(), self.HealAmount)
if self:Clip1() >= need and owner:Health() < owner:GetMaxHealth() then
self:TakePrimaryAmmo(need)
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + need))
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self:SequenceDuration() + 0.5)
owner:SetAnimation(PLAYER_ATTACK1)
else
if need > self.HealAmount then
owner:EmitSound(EmptySoundVO)
end
self:SetNextPrimaryFire(CurTime() + 1)
end
return
end
local deployEnt = ents.Create("v92_bf2_medikit_ent")
if not IsValid(deployEnt) then
self:SetNextPrimaryFire(CurTime() + 0.5)
return
end
deployEnt:SetPos(owner:GetPos() + Vector(0, 0, 50))
deployEnt:SetAngles(owner:GetAngles())
deployEnt:SetOwner(owner)
deployEnt:Spawn()
if deployEnt.AttachToPlayer and deployEnt:AttachToPlayer(owner) then
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self:SequenceDuration() + 0.5)
owner:SetAnimation(PLAYER_ATTACK1)
else
self:SetNextPrimaryFire(CurTime() + 0.5)
end
end
function SWEP:SecondaryAttack()
return
end
function SWEP:OnRemove()
timer.Stop( "medkit_ammo" .. self:EntIndex() )
end
function SWEP:Holster()
return true
end
function SWEP:CustomAmmoDisplay()
self.AmmoDisplay = self.AmmoDisplay or {}
self.AmmoDisplay.Draw = true
if self.Primary.ClipSize > 0 then
self.AmmoDisplay.PrimaryClip = self:Clip1()
self.AmmoDisplay.PrimaryAmmo = self:Ammo1()
end
if self.Secondary.ClipSize > 0 then
self.AmmoDisplay.SecondaryAmmo = self:Ammo2()
end
return self.AmmoDisplay
end
-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------