mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
15
gamemodes/darkrp/plugins/stealth/cl_plugin.lua
Normal file
15
gamemodes/darkrp/plugins/stealth/cl_plugin.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
CHAT_RECOGNIZED = CHAT_RECOGNIZED or {}
|
||||
CHAT_RECOGNIZED["mev"] = true
|
||||
CHAT_RECOGNIZED["sv"] = true
|
||||
|
||||
15
gamemodes/darkrp/plugins/stealth/languages/sh_english.lua
Normal file
15
gamemodes/darkrp/plugins/stealth/languages/sh_english.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
LANGUAGE = {
|
||||
cmdMev = "Réaliser une action visuelle.",
|
||||
cmdSV = "Communiquer visuellement."
|
||||
}
|
||||
15
gamemodes/darkrp/plugins/stealth/languages/sh_french.lua
Normal file
15
gamemodes/darkrp/plugins/stealth/languages/sh_french.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
LANGUAGE = {
|
||||
cmdMev = "Réaliser une action visuelle.",
|
||||
cmdSV = "Communiquer visuellement."
|
||||
}
|
||||
43
gamemodes/darkrp/plugins/stealth/meta/sv_entity.lua
Normal file
43
gamemodes/darkrp/plugins/stealth/meta/sv_entity.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| 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 entityMeta = FindMetaTable("Entity")
|
||||
|
||||
function entityMeta:StealthOpenDoor()
|
||||
if (!self.stealthOpen) then
|
||||
self.stealthOpen = true
|
||||
|
||||
self.oldSpeed = self:GetInternalVariable("Speed")
|
||||
self:SetSaveValue("Speed", self.oldSpeed / 2)
|
||||
|
||||
local uniqueID = self:EntIndex() and self:EntIndex() or tostring(self:GetPos())
|
||||
|
||||
timer.Create("resetDoorStealthValue" .. uniqueID, 5 * (self:GetInternalVariable("speed") / (self:GetClass() == "prop_door_rotating" and self:GetInternalVariable("distance") or self:GetInternalVariable("m_flMoveDistance"))), 1, function()
|
||||
if (self:GetSaveTable().m_eDoorState != 1 and self:GetSaveTable().m_eDoorState != 3) then
|
||||
timer.Simple(5, function()
|
||||
self:SetSaveValue("Speed", self.oldSpeed)
|
||||
self.stealthOpen = false
|
||||
end)
|
||||
else
|
||||
timer.Create("checkForDoorReset" .. self:EntIndex(), 0.1, 0, function()
|
||||
if (self:GetSaveTable().m_eDoorState != 1 and self:GetSaveTable().m_eDoorState != 3) then
|
||||
timer.Simple(5, function()
|
||||
self:SetSaveValue("Speed", self.oldSpeed)
|
||||
self.stealthOpen = false
|
||||
end)
|
||||
|
||||
timer.Remove("checkForDoorReset" .. self:EntIndex())
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
74
gamemodes/darkrp/plugins/stealth/sh_plugin.lua
Normal file
74
gamemodes/darkrp/plugins/stealth/sh_plugin.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
--[[
|
||||
| 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 = "Stealth"
|
||||
PLUGIN.author = "Aspect™"
|
||||
PLUGIN.description = "Adds several stealth-related features."
|
||||
|
||||
ix.util.Include("meta/sv_entity.lua")
|
||||
ix.util.Include("cl_plugin.lua")
|
||||
ix.util.Include("sv_hooks.lua")
|
||||
|
||||
ix.chat.Register("mev", {
|
||||
format = "*** %s %s",
|
||||
color = Color(128, 128, 128, 255),
|
||||
CanHear = function(self, speaker, listener)
|
||||
if (speaker:GetEyeTraceNoCursor().Entity == listener or speaker == listener) then
|
||||
return true
|
||||
else
|
||||
local trace = {}
|
||||
|
||||
trace.mask = CONTENTS_SOLID + CONTENTS_MOVEABLE + CONTENTS_OPAQUE + CONTENTS_DEBRIS + CONTENTS_HITBOX + CONTENTS_MONSTER
|
||||
trace.start = listener:LocalToWorld(listener:OBBCenter())
|
||||
trace.endpos = speaker:GetShootPos()
|
||||
trace.filter = {listener, speaker}
|
||||
|
||||
trace = util.TraceLine(trace)
|
||||
|
||||
if (trace.Fraction >= (0.75)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
prefix = {"/MeV"},
|
||||
description = "@cmdMev",
|
||||
indicator = "chatPerforming"
|
||||
})
|
||||
|
||||
ix.chat.Register("sv", {
|
||||
format = "*** %s mouvemente \"%s\"",
|
||||
color = Color(128, 128, 128, 255),
|
||||
CanHear = function(self, speaker, listener)
|
||||
if (speaker:GetEyeTraceNoCursor().Entity == listener or speaker == listener) then
|
||||
return true
|
||||
else
|
||||
local trace = {}
|
||||
|
||||
trace.mask = CONTENTS_SOLID + CONTENTS_MOVEABLE + CONTENTS_OPAQUE + CONTENTS_DEBRIS + CONTENTS_HITBOX + CONTENTS_MONSTER
|
||||
trace.start = listener:LocalToWorld(listener:OBBCenter())
|
||||
trace.endpos = speaker:GetShootPos()
|
||||
trace.filter = {listener, speaker}
|
||||
|
||||
trace = util.TraceLine(trace)
|
||||
|
||||
if (trace.Fraction >= (0.75)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
prefix = {"/SV"},
|
||||
description = "@cmdSV",
|
||||
indicator = "chatPerforming"
|
||||
})
|
||||
42
gamemodes/darkrp/plugins/stealth/sv_hooks.lua
Normal file
42
gamemodes/darkrp/plugins/stealth/sv_hooks.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function PLUGIN:PlayerFootstep(client, position, foot, soundName, volume)
|
||||
if (client:KeyDown(IN_WALK) or client:KeyDown(IN_DUCK)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:AcceptInput(entity, input, activator, caller, value)
|
||||
if (input == "Use" and entity:IsDoor() and (activator:KeyDown(IN_WALK) or activator:KeyDown(IN_DUCK))) then
|
||||
entity:StealthOpenDoor()
|
||||
|
||||
if (entity:GetInternalVariable("slavename")) then
|
||||
for _, slave in pairs(ents.FindByName(entity:GetInternalVariable("slavename"))) do
|
||||
slave:StealthOpenDoor()
|
||||
end
|
||||
end
|
||||
|
||||
for _, slave in pairs(ents.FindByName(entity:GetName())) do
|
||||
slave:StealthOpenDoor()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:EntityEmitSound(data)
|
||||
if !data.Entity or data.Entity and !IsValid(data.Entity) then return end
|
||||
|
||||
if (data.Entity:IsDoor() and data.Entity.stealthOpen) then
|
||||
data.Volume = data.Volume * 0.05
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user