This commit is contained in:
lifestorm
2024-08-04 22:55:00 +03:00
parent 8064ba84d8
commit 73479cff9e
7338 changed files with 1718883 additions and 14 deletions

View File

@@ -0,0 +1,89 @@
--[[
| 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 LocalPlayer = LocalPlayer
local ix = ix
local vgui = vgui
local L = L
local Color = Color
local SScaleMin = SScaleMin
function PLUGIN:IsPlayerRecognized(client)
local fakeNames = LocalPlayer():GetCharacter():GetFakeNames()
if (fakeNames and client:GetCharacter() and fakeNames[client:GetCharacter():GetID()]) then
return true
end
end
function PLUGIN:GetCharacterName(client, chatType)
if (!IsValid(client)) then return end
local localCharacter = LocalPlayer().GetCharacter and LocalPlayer():GetCharacter()
if (!localCharacter) then return end
local clientCharacter = client:GetCharacter()
if (!clientCharacter) then return end
if (!hook.Run("IsCharacterRecognized", localCharacter, clientCharacter:GetID())) then
local fakeNames = localCharacter:GetFakeNames()
if (fakeNames and clientCharacter) then
local fakeName = fakeNames[clientCharacter:GetID()]
if (fakeName and fakeName != true) then
return fakeName
end
end
end
end
function PLUGIN:ShouldShowPlayerOnScoreboard(client, panel)
local playerFaction = ix.faction.Get(client:GetCharacter():GetFaction())
if (!panel.unknown and !LocalPlayer():GetCharacter():DoesRecognize(client:GetCharacter()) and !playerFaction.separateUnknownTab) then
return false
end
end
local function FakeRecognize(level)
net.Start("ixRecognizeFakeName")
net.WriteUInt(level, 2)
net.SendToServer()
end
function PLUGIN:RecognizeMenuOpened(menu)
local fakeName = LocalPlayer():GetCharacter():GetFakeName()
if (fakeName and fakeName != "") then
local lookingAt = menu:AddOption(L("rgnFakeLookingAt", fakeName), function()
FakeRecognize(0)
end)
local whisper = menu:AddOption(L("rgnFakeWhisper", fakeName), function()
FakeRecognize(1)
end)
local talk = menu:AddOption(L("rgnFakeTalk", fakeName), function()
FakeRecognize(2)
end)
local yell = menu:AddOption(L("rgnFakeYell", fakeName), function()
FakeRecognize(3)
end)
lookingAt:SetFont("MenuFontNoClamp")
lookingAt:SetTextColor(Color(200, 100, 100))
whisper:SetFont("MenuFontNoClamp")
whisper:SetTextColor(Color(200, 100, 100))
talk:SetFont("MenuFontNoClamp")
talk:SetTextColor(Color(200, 100, 100))
yell:SetFont("MenuFontNoClamp")
yell:SetTextColor(Color(200, 100, 100))
end
end

View File

@@ -0,0 +1,22 @@
--[[
| 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 = {
fakeName = "Vous avez maintenant comme faux nom : \"%s\".",
noFakeName = "Vous avez retiré votre faux nom.",
fakeNameLength = "Votre faux nom doit faire au minimum %d caractères, et maximum %d caractères.",
fakeNameTitle = "Faux nom",
fakeNameText = "Entrez votre faux nom",
rgnFakeLookingAt = "Permettre à la personne que vous regardez de vous reconnaître en tant que \"%s\".",
rgnFakeWhisper = "Permettre à ceux qui vous entendent chuchoter de vous reconnaître en tant que \"%s\".",
rgnFakeTalk = "Permettre à ceux qui entendent vos conversatins de vous reconnaître en tant que \"%s\".",
rgnFakeYell = "Permettre à ceux qui entendent vos cris de vous reconnaître en tant que \"%s\"."
}

View File

@@ -0,0 +1,22 @@
--[[
| 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 = {
fakeName = "Vous avez maintenant comme faux nom : \"%s\".",
noFakeName = "Vous avez retiré votre faux nom.",
fakeNameLength = "Votre faux nom doit faire au minimum %d caractères, et maximum %d caractères.",
fakeNameTitle = "Faux nom",
fakeNameText = "Entrez votre faux nom",
rgnFakeLookingAt = "Permettre à la personne que vous regardez de vous reconnaître en tant que \"%s\".",
rgnFakeWhisper = "Permettre à ceux qui vous entendent chuchoter de vous reconnaître en tant que \"%s\".",
rgnFakeTalk = "Permettre à ceux qui entendent vos conversatins de vous reconnaître en tant que \"%s\".",
rgnFakeYell = "Permettre à ceux qui entendent vos cris de vous reconnaître en tant que \"%s\"."
}

View File

@@ -0,0 +1,17 @@
--[[
| 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 = {
fakeName = "Вы будете представляться под именем %s.",
noFakeName = "Вы будете представляться под Вашим реальным именем.",
fakeNameLength = "Ваше ненастоящее имя должно иметь длину от %d до %d символов",
fakeNameTitle = "Ненастоящее имя",
fakeNameText = "Под каким именем Вы будете представляться?"
}

View File

@@ -0,0 +1,17 @@
--[[
| 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 = {
noFakeName = "Los demás te reconocerán por tu nombre real.",
fakeName = "Los demás te reconocerán por tu nombre falso '%s'.",
fakeNameTitle = "Nombre Falso",
fakeNameLength = "Tu nombre falso debe tener como mínimo %d carácteres y un máximo de %d carácteres",
fakeNameText = "¿Con qué nombre te reconocerás a ti mismo?"
}

View File

@@ -0,0 +1,34 @@
--[[
| 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 ix = ix
PLUGIN.name = "Fake Names"
PLUGIN.author = "AleXXX_007"
PLUGIN.description = "Allows characters to recognize themselves with a fake name."
ix.util.Include("cl_hooks.lua")
ix.util.Include("sv_hooks.lua")
ix.char.RegisterVar("fakeName", {
field = "fakeName",
fieldType = ix.type.string,
default = "",
isLocal = true,
bNoDisplay = true
})
ix.char.RegisterVar("fakeNames", {
field = "fakeNames",
default = {},
isLocal = true,
bNoDisplay = true
})

View File

@@ -0,0 +1,80 @@
--[[
| 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 util = util
local net = net
local ipairs = ipairs
util.AddNetworkString("ixFakeName")
util.AddNetworkString("ixRecognizeFakeName")
net.Receive("ixFakeName", function(length, client)
local text = net.ReadString()
text = text != "" and text or nil
client:GetCharacter():SetFakeName(text)
if (text) then
client:NotifyLocalized("fakeName", text)
else
client:NotifyLocalized("noFakeName")
end
end)
net.Receive("ixRecognizeFakeName", function(_, client)
local level = net.ReadUInt(2)
local fakeName = client:GetCharacter():GetFakeName()
local recogCharID = client:GetCharacter():GetID()
local targets = {}
if (level < 1) then
local entity = client:GetEyeTraceNoCursor().Entity
if (IsValid(entity) and entity:IsPlayer() and entity:GetCharacter()
and ix.chat.classes.ic:CanHear(client, entity)) then
targets[1] = entity
end
else
local class = "w"
if (level == 2) then
class = "ic"
elseif (level == 3) then
class = "y"
end
class = ix.chat.classes[class]
for _, v in ipairs(player.GetAll()) do
if (client != v and v:GetCharacter() and class:CanHear(client, v)) then
targets[#targets + 1] = v
end
end
end
if (#targets > 0) then
for _, v in ipairs(targets) do
local fakeNames = v:GetCharacter():GetFakeNames()
if (fakeNames[recogCharID] == true) then
continue
end
if (fakeName and fakeName != "") then
fakeNames[recogCharID] = fakeName
else
fakeNames[recogCharID] = true
end
v:GetCharacter():SetFakeNames(fakeNames)
end
end
end)