mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
49
gamemodes/darkrp/plugins/terranova/sh_doorkick.lua
Normal file
49
gamemodes/darkrp/plugins/terranova/sh_doorkick.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ix.command.Add("Doorkick", {
|
||||
description = "Foutre un coup de pied dans une porte.",
|
||||
OnCheckAccess = function(self, client)
|
||||
if (!ix.faction.Get(client:Team()).allowKickDoor) then
|
||||
return false
|
||||
end
|
||||
|
||||
local entity = client:GetEyeTrace().Entity
|
||||
if (!IsValid(entity) or !entity:IsDoor() or entity:GetNetVar("disabled")) then
|
||||
return false, "Vous ne regardez pas une porte !"
|
||||
end
|
||||
|
||||
if (client:GetPos():DistToSqr(entity:GetPos()) > 10000) then
|
||||
return false, "Tu n'es pas assez proche !"
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
OnRun = function(self, client)
|
||||
local entity = client:GetEyeTrace().Entity
|
||||
if (IsValid(entity.ixLock)) then
|
||||
return "Vous ne pouvez pas taper dans une porte avec une serrure du cartel !"
|
||||
end
|
||||
|
||||
local current = client:GetLocalVar("stm", 0)
|
||||
if (current > 90) then
|
||||
client:ConsumeStamina(15)
|
||||
client:ForceSequence("adoorkick", nil, 1.5)
|
||||
|
||||
timer.Simple(0.5, function()
|
||||
entity:Fire("unlock")
|
||||
entity:Fire("open")
|
||||
end)
|
||||
else
|
||||
client:Notify("Vous n'avez pas assez d'endurance !")
|
||||
end
|
||||
end
|
||||
})
|
||||
165
gamemodes/darkrp/plugins/terranova/sh_extendedrpcommands.lua
Normal file
165
gamemodes/darkrp/plugins/terranova/sh_extendedrpcommands.lua
Normal file
@@ -0,0 +1,165 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
--[[
|
||||
© 2020 TERRANOVA do not share, re-distribute or modify
|
||||
without permission of its author (zacharyenriquee@gmail.com).
|
||||
--]]
|
||||
|
||||
ix.chat.Register("meL", {
|
||||
OnChatAdd = function(self, speaker, text, anonymous)
|
||||
if (!IsValid(speaker)) then
|
||||
return
|
||||
end
|
||||
local name = anonymous and
|
||||
L"someone" or hook.Run("GetCharacterName", speaker, "me") or
|
||||
(IsValid(speaker) and speaker:Name() or "Console")
|
||||
|
||||
local chatColor = ix.config.Get("chatColor")
|
||||
chatColor = Color(chatColor.r + 35, chatColor.g + 35, chatColor.b + 35)
|
||||
|
||||
chat.AddText(chatColor, "**** ", name, " ", text)
|
||||
end,
|
||||
CanHear = ix.config.Get("chatRange", 280) * 4,
|
||||
prefix = {"/MeL", "/ActionL"},
|
||||
description = "Effectuer une action physique bruyament.",
|
||||
indicator = "chatPerforming",
|
||||
CanSay = function(self, speaker, text)
|
||||
if (!speaker:Alive() and speaker.lastMeExpended) then
|
||||
speaker:NotifyLocalized("noPerm")
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.chat.Register("meC", {
|
||||
OnChatAdd = function(self, speaker, text, anonymous)
|
||||
if (!IsValid(speaker)) then
|
||||
return
|
||||
end
|
||||
|
||||
local name = anonymous and
|
||||
L"someone" or hook.Run("GetCharacterName", speaker, "me") or
|
||||
(IsValid(speaker) and speaker:Name() or "Console")
|
||||
|
||||
local chatColor = ix.config.Get("chatColor")
|
||||
chatColor = Color(chatColor.r - 35, chatColor.g - 35, chatColor.b - 35)
|
||||
|
||||
chat.AddText(chatColor, "* ", name, " ", text)
|
||||
end,
|
||||
CanHear = ix.config.Get("chatRange", 280) * 0.25,
|
||||
prefix = {"/MeC", "/ActionC"},
|
||||
description = "Effectuer une action physique discretement.",
|
||||
indicator = "chatPerforming",
|
||||
CanSay = function(self, speaker, text)
|
||||
if (!speaker:Alive() and speaker.lastMeExpended) then
|
||||
speaker:NotifyLocalized("noPerm")
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.chat.Register("meD", {
|
||||
OnChatAdd = function(self, speaker, text, anonymous)
|
||||
if (!IsValid(speaker)) then
|
||||
return
|
||||
end
|
||||
|
||||
local name = anonymous and
|
||||
L"someone" or hook.Run("GetCharacterName", speaker, "me") or
|
||||
(IsValid(speaker) and speaker:Name() or "Console")
|
||||
|
||||
local chatColor = ix.config.Get("chatColor")
|
||||
chat.AddText(chatColor, "** ", name, " ", text)
|
||||
end,
|
||||
deadCanChat = true
|
||||
})
|
||||
|
||||
ix.command.Add("MeD", {
|
||||
description = "Envoyez un /me directement à la personne que vous regardez.",
|
||||
alias = "ActionD",
|
||||
arguments = ix.type.text,
|
||||
OnCheckAccess = function(self, client)
|
||||
local trace = client:GetEyeTraceNoCursor()
|
||||
if (!IsValid(trace.Entity) or !trace.Entity:IsPlayer()) then return false end
|
||||
|
||||
return true
|
||||
end,
|
||||
OnRun = function(self, client, text)
|
||||
ix.chat.Send(client, "meD", text, nil, {client, client:GetEyeTraceNoCursor().Entity})
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
ix.chat.Register("itL", {
|
||||
GetColor = function(self, speaker, text)
|
||||
local color = ix.config.Get("chatColor")
|
||||
|
||||
return Color(color.r + 35, color.g + 35, color.b + 35)
|
||||
end,
|
||||
OnChatAdd = function(self, speaker, text)
|
||||
chat.AddText(ix.config.Get("chatColor"), "****' "..text)
|
||||
end,
|
||||
CanHear = ix.config.Get("chatRange", 280) * 4,
|
||||
prefix = {"/ItL"},
|
||||
description = "Faites quelque chose autour de vous pour effectuer une action bruyament.",
|
||||
indicator = "chatPerforming",
|
||||
deadCanChat = true
|
||||
})
|
||||
|
||||
ix.chat.Register("itC", {
|
||||
GetColor = function(self, speaker, text)
|
||||
local color = ix.config.Get("chatColor")
|
||||
|
||||
return Color(color.r - 35, color.g - 35, color.b - 35)
|
||||
end,
|
||||
OnChatAdd = function(self, speaker, text)
|
||||
chat.AddText(ix.config.Get("chatColor"), "*' "..text)
|
||||
end,
|
||||
CanHear = ix.config.Get("chatRange", 280) * 0.25,
|
||||
prefix = {"/ItC"},
|
||||
description = "Faites quelque chose autour de vous pour effectuer une action discretement.",
|
||||
indicator = "chatPerforming",
|
||||
deadCanChat = true
|
||||
})
|
||||
|
||||
ix.chat.Register("itD", {
|
||||
OnChatAdd = function(self, speaker, text, anonymous)
|
||||
local chatColor = ix.config.Get("chatColor")
|
||||
chat.AddText(chatColor, "**' "..text)
|
||||
end,
|
||||
deadCanChat = true
|
||||
})
|
||||
|
||||
ix.command.Add("ItD", {
|
||||
description = "Envoyez un /it directement à la personne que vous regardez (et à personne d'autre).",
|
||||
arguments = ix.type.text,
|
||||
OnCheckAccess = function(self, client)
|
||||
local trace = client:GetEyeTraceNoCursor()
|
||||
if (!IsValid(trace.Entity) or !trace.Entity:IsPlayer()) then return false end
|
||||
|
||||
return true
|
||||
end,
|
||||
OnRun = function(self, client, text)
|
||||
ix.chat.Send(client, "itD", text, nil, {client, client:GetEyeTraceNoCursor().Entity})
|
||||
end
|
||||
})
|
||||
|
||||
if (CLIENT) then
|
||||
CHAT_RECOGNIZED = CHAT_RECOGNIZED or {}
|
||||
CHAT_RECOGNIZED["itC"] = true
|
||||
CHAT_RECOGNIZED["itL"] = true
|
||||
CHAT_RECOGNIZED["itD"] = true
|
||||
CHAT_RECOGNIZED["meC"] = true
|
||||
CHAT_RECOGNIZED["meL"] = true
|
||||
CHAT_RECOGNIZED["meD"] = true
|
||||
end
|
||||
19
gamemodes/darkrp/plugins/terranova/sh_plugin.lua
Normal file
19
gamemodes/darkrp/plugins/terranova/sh_plugin.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
| 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 PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.name = "Terranova Plugins"
|
||||
PLUGIN.description = "Adds certain Terranova plugins to the schema."
|
||||
PLUGIN.author = "Adolphus, Fruity"
|
||||
|
||||
ix.util.Include("sh_doorkick.lua")
|
||||
ix.util.Include("sh_shootablelocks.lua")
|
||||
ix.util.Include("sh_extendedrpcommands.lua")
|
||||
71
gamemodes/darkrp/plugins/terranova/sh_shootablelocks.lua
Normal file
71
gamemodes/darkrp/plugins/terranova/sh_shootablelocks.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
--[[
|
||||
© 2020 TERRANOVA do not share, re-distribute or modify
|
||||
without permission of its author.
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
local SHOOT_DISTANCE = 180 * 180
|
||||
|
||||
function PLUGIN:EntityTakeDamage(entity, dmgInfo)
|
||||
if (entity:GetClass() == "prop_door_rotating" and (entity.NextBreach or 0) < CurTime()) then
|
||||
local handle = entity:LookupBone("handle")
|
||||
|
||||
if (handle and dmgInfo:IsBulletDamage()) then
|
||||
local client = dmgInfo:GetAttacker()
|
||||
local position = dmgInfo:GetDamagePosition()
|
||||
|
||||
if (!client:IsPlayer() or client:GetEyeTrace().Entity != entity or client:GetPos():DistToSqr(position) > SHOOT_DISTANCE) then
|
||||
return
|
||||
end
|
||||
|
||||
if (entity.ixLock) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (entity.doorPartner and entity.doorPartner.ixLock) then
|
||||
return false
|
||||
end
|
||||
|
||||
if (IsValid(client) and position:DistToSqr(entity:GetBonePosition(handle)) <= 12 * 12) then
|
||||
if (hook.Run("CanPlayerBustLock", client, entity) == false) then
|
||||
return
|
||||
end
|
||||
|
||||
local effect = EffectData()
|
||||
effect:SetStart(position)
|
||||
effect:SetOrigin(position)
|
||||
effect:SetScale(2)
|
||||
util.Effect("GlassImpact", effect)
|
||||
|
||||
local name = client:SteamID64()..CurTime()
|
||||
client:SetName(name)
|
||||
|
||||
entity.OldSpeed = entity.OldSpeed or entity:GetKeyValues().speed or 100
|
||||
|
||||
entity:Fire("setspeed", entity.OldSpeed * 5)
|
||||
entity:Fire("unlock")
|
||||
entity:Fire("openawayfrom", name)
|
||||
entity:EmitSound("physics/wood/wood_plank_break"..math.random(1, 4)..".wav", 100, 120)
|
||||
|
||||
entity.NextBreach = CurTime() + 1
|
||||
|
||||
timer.Simple(0.5, function()
|
||||
if (IsValid(entity)) then
|
||||
entity:Fire("setspeed", entity.OldSpeed)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user