mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local AddCSLuaFile = AddCSLuaFile
|
||||
local IsValid = IsValid
|
||||
local ents = ents
|
||||
local timer = timer
|
||||
local ix = ix
|
||||
local Color = Color
|
||||
local render = render
|
||||
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Charge creuse"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminOnly = true
|
||||
ENT.PhysgunDisable = true
|
||||
ENT.bNoPersist = true
|
||||
|
||||
if (SERVER) then
|
||||
function ENT:GetHandlePosition(door, position, normal)
|
||||
normal = normal or door:GetForward():Angle()
|
||||
position = position + normal:Forward() * 0 + normal:Up() * 0 + normal:Right() * 0
|
||||
|
||||
normal:RotateAroundAxis(normal:Forward(), 180)
|
||||
normal:RotateAroundAxis(normal:Right(), 270)
|
||||
|
||||
return position, normal
|
||||
end
|
||||
|
||||
function ENT:SetDoor(door, position, angles)
|
||||
if (!IsValid(door) or !door:IsDoor()) then
|
||||
return
|
||||
end
|
||||
|
||||
self.door = door
|
||||
self.door:DeleteOnRemove(self)
|
||||
door.ixBreach = self
|
||||
|
||||
self:SetPos(position)
|
||||
self:SetAngles(angles)
|
||||
self:SetParent(door)
|
||||
end
|
||||
|
||||
function ENT:SpawnFunction(client, trace)
|
||||
local door = trace.Entity
|
||||
|
||||
if (!IsValid(door) or !door:IsDoor() or IsValid(door.ixLock)) then
|
||||
return client:NotifyLocalized("dNotValid")
|
||||
end
|
||||
|
||||
local normal = trace.HitNormal:Angle()
|
||||
local position, angles = self:GetHandlePosition(door, trace.HitPos, normal)
|
||||
|
||||
local entity = ents.Create("ix_breachingcharge")
|
||||
entity:SetPos(trace.HitPos)
|
||||
entity:Spawn()
|
||||
entity:Activate()
|
||||
entity:SetDoor(door, position, angles)
|
||||
|
||||
-- entity:EmitSound("weapons/c4/c4_plant.wav", 80)
|
||||
-- entity:EmitSound("weapons/c4/c4_disarm.wav", 100)
|
||||
|
||||
self:BlowUp()
|
||||
|
||||
return entity
|
||||
end
|
||||
|
||||
function ENT:BlowUp()
|
||||
if (!IsValid(self.door) or self.bIsBlowingUP) then
|
||||
return
|
||||
end
|
||||
|
||||
self.bIsBlowingUP = true
|
||||
|
||||
local func = function()
|
||||
if (IsValid(self)) then
|
||||
self:EmitSound("weapons/c4/c4_click.wav")
|
||||
end
|
||||
end
|
||||
timer.Simple(1.0, func)
|
||||
timer.Simple(2.0, func)
|
||||
timer.Simple(3.0, func)
|
||||
timer.Simple(3.5, func)
|
||||
timer.Simple(4.0, func)
|
||||
timer.Simple(4.2, func)
|
||||
timer.Simple(4.5, func)
|
||||
timer.Simple(4.7, func)
|
||||
timer.Simple(4.9, func)
|
||||
timer.Simple(5.0, function()
|
||||
if (IsValid(self)) then
|
||||
local explode = ents.Create("env_explosion")
|
||||
explode:SetPos(self:GetPos())
|
||||
explode:SetOwner(self)
|
||||
explode:Spawn()
|
||||
explode:SetKeyValue("iMagnitude", 100)
|
||||
explode:SetKeyValue("iRadiusOverride", 30)
|
||||
explode:Fire("Exploser", 0, 0)
|
||||
explode:EmitSound("weapons/c4/c4_explode1.wav", 100, 100)
|
||||
self.door:BlastDoor(self:GetUp() * -750, 60, false)
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/weapons/w_c4_planted.mdl")
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self.nextUseTime = 0
|
||||
end
|
||||
|
||||
function ENT:Use()
|
||||
self:EmitSound("buttons/button9.wav")
|
||||
self:BlowUp()
|
||||
end
|
||||
else
|
||||
local glowMaterial = ix.util.GetMaterial("sprites/glow04_noz")
|
||||
local color_red = Color(255, 50, 50, 255)
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
|
||||
local color = color_red
|
||||
|
||||
local position = self:GetPos() + self:GetUp() * 4.25 + self:GetForward() * 1.25 + self:GetRight() * 2.1
|
||||
|
||||
render.SetMaterial(glowMaterial)
|
||||
render.DrawSprite(position, 3, 3, color)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Charge creuse"
|
||||
|
||||
ITEM.description = "Cet objet métallique en forme de cylindre a l'air plutôt lourd et massif. Il est composé de deux parties, une coque extérieure et une charge explosive à l'intérieur, et est destiné à causer des dégâts importants à un objet ou un bâtiment lorsqu'il est déclenché. Des marques et des numéros sont gravés sur la surface, probablement pour aider à son identification ou à son suivi. Globalement, il semble très dangereux et doit être manipulé avec une extrême prudence."
|
||||
|
||||
ITEM.description = "Sa surface métallique lisse dissimule son potentiel destructeur. Au cœur de cette ogive se trouve une charge explosive spécialement conçue pour percer les matériaux les plus résistants."
|
||||
|
||||
ITEM.model = Model("models/weapons/w_c4_planted.mdl")
|
||||
ITEM.width = 2
|
||||
ITEM.height = 1
|
||||
ITEM.category = "Combine"
|
||||
ITEM.KeepOnDeath = true
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-0.5, 50, 2),
|
||||
ang = Angle(0, 270, 0),
|
||||
fov = 25.29
|
||||
}
|
||||
|
||||
ITEM.functions.Place = {
|
||||
name = "Placer",
|
||||
OnRun = function(itemTable)
|
||||
local client = itemTable.player
|
||||
local data = {}
|
||||
data.start = client:GetShootPos()
|
||||
data.endpos = data.start + client:GetAimVector() * 96
|
||||
data.filter = client
|
||||
|
||||
local breach = scripted_ents.Get("ix_breachingcharge"):SpawnFunction(client, util.TraceLine(data))
|
||||
|
||||
if (IsValid(breach)) then
|
||||
client:EmitSound("weapons/c4/c4_plant.wav", 80)
|
||||
client:EmitSound("weapons/c4/c4_disarm.wav", 100)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
}
|
||||
13
gamemodes/darkrp/plugins/breaching_charge/sh_plugin.lua
Normal file
13
gamemodes/darkrp/plugins/breaching_charge/sh_plugin.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
PLUGIN.name = "Breaching Charge"
|
||||
PLUGIN.author = "Uzi"
|
||||
PLUGIN.description = "A breaching charge item and entity for Willard Networks"
|
||||
Reference in New Issue
Block a user