mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
89
gamemodes/helix/plugins/fakenames/cl_hooks.lua
Normal file
89
gamemodes/helix/plugins/fakenames/cl_hooks.lua
Normal 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
|
||||
22
gamemodes/helix/plugins/fakenames/languages/sh_english.lua
Normal file
22
gamemodes/helix/plugins/fakenames/languages/sh_english.lua
Normal 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 = "Sahte adınızı \"%s\" olarak ayarladınız.",
|
||||
noFakeName = "Sahte adınızı kaldırdınız.",
|
||||
fakeNameLength = "Sahte adınız en az %d karakter olmalı ve en fazla %d karakter olmalıdır.",
|
||||
fakeNameTitle = "Sahte Ad",
|
||||
fakeNameText = "Kendinizi tanımak için hangi adı kullanacaksınız?",
|
||||
rgnFakeLookingAt = "Bakmakta olduğunuz kişinin sizi \"%s\" olarak tanımasına izin ver.",
|
||||
rgnFakeWhisper = "Fısıldama mesafesindekilerin sizi \"%s\" olarak tanımasına izin ver.",
|
||||
rgnFakeTalk = "Konuşma mesafesindekilerin sizi \"%s\" olarak tanımasına izin ver.",
|
||||
rgnFakeYell = "Bağırma mesafesindekilerin sizi \"%s\" olarak tanımasına izin ver."
|
||||
}
|
||||
17
gamemodes/helix/plugins/fakenames/languages/sh_russian.lua
Normal file
17
gamemodes/helix/plugins/fakenames/languages/sh_russian.lua
Normal 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 = "Под каким именем Вы будете представляться?"
|
||||
}
|
||||
17
gamemodes/helix/plugins/fakenames/languages/sh_spanish.lua
Normal file
17
gamemodes/helix/plugins/fakenames/languages/sh_spanish.lua
Normal 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?"
|
||||
}
|
||||
34
gamemodes/helix/plugins/fakenames/sh_plugin.lua
Normal file
34
gamemodes/helix/plugins/fakenames/sh_plugin.lua
Normal 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
|
||||
})
|
||||
80
gamemodes/helix/plugins/fakenames/sv_hooks.lua
Normal file
80
gamemodes/helix/plugins/fakenames/sv_hooks.lua
Normal 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)
|
||||
Reference in New Issue
Block a user