This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 8064ba84d8
commit 6a58f406b1
7522 changed files with 4011896 additions and 15 deletions

View File

@@ -0,0 +1,44 @@
--[[
| 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
function PLUGIN:PopulateImportantCharacterInfo(targClient, targCharacter, container)
local nicknameText = self:GetTargClientNickname(targClient)
if (nicknameText) then
local nickname = container:AddRow("nicknameText")
nickname:SetText("Nickname: "..nicknameText)
nickname:SetBackgroundColor(Color(150, 150, 150, 255))
nickname:SizeToContents()
end
end
function PLUGIN:GetTargClientNickname(targClient)
local nickNames = LocalPlayer():GetCharacter():GetNickNames()
if !nickNames or (nickNames and !istable(nickNames)) then return false end
local targChar = targClient:GetCharacter()
local targCharID = targChar:GetID()
if !targCharID then return false end
if targClient:GetNetVar("ixMaskEquipped") then
return false
end
if targClient:GetNetVar("combineMaskEquipped") then
return false
end
if nickNames[targChar:GetID()] then
return nickNames[targChar:GetID()]
else
return false
end
end

View File

@@ -0,0 +1,51 @@
--[[
| 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 = "Nicknames"
PLUGIN.author = "Fruity"
PLUGIN.description = "Implements nicknames possible for unmasked/unhidden individuals."
ix.util.Include("sv_plugin.lua")
ix.util.Include("cl_plugin.lua")
ix.char.RegisterVar("nickNames", {
field = "nickNames",
default = {},
isLocal = true,
bNoDisplay = true
})
ix.config.Add("maxNicknameLength", 40, "The max amount of characters for an assigned nickname.", nil,
{data = {min = 1, max = 60}, category = "Nicknames"}
)
ix.command.Add("SetNickname", {
description = "Set a nickname to an unmasked individual.",
arguments = {
ix.type.string
},
OnRun = function(self, client, nickname)
if (SERVER) then
PLUGIN:SetNickName(client, nickname)
end
end
})
ix.command.Add("RemoveNickname", {
description = "Removes a nickname added to an unmasked individual.",
OnRun = function(self, client)
if (SERVER) then
PLUGIN:SetNickName(client, nil)
end
end
})

View File

@@ -0,0 +1,53 @@
--[[
| 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
function PLUGIN:SetNickName(client, nickname)
if (nickname) then
if string.len(nickname) <= 1 then
client:Notify("Bu takma ad çok kısa!")
return
end
if string.len(nickname) > ix.config.Get("maxNicknameLength", 40) then
client:Notify("Bu takma ad çok uzun!")
return
end
end
local target = client:GetEyeTraceNoCursor().Entity
if (!IsValid(target) or !(target:IsPlayer() or target:GetClass() == "prop_ragdoll")) then
client:Notify("Geçerli bir hedefe bakıyor olmalısınız!")
return
end
if target:GetNetVar("ixMaskEquipped") then
client:Notify("Maskeli kişilere takma ad atayamazsınız!")
return false
end
if target:GetNetVar("combineMaskEquipped") then
client:Notify("Maskeli kişilere takma ad atayamazsınız!")
return false
end
local localChar = client:GetCharacter()
local targCharacter = (target.GetCharacter and target:GetCharacter() or false)
if !targCharacter or !localChar then return false end
local targetCharID = targCharacter:GetID()
local nickNames = localChar:GetNickNames()
nickNames[targetCharID] = nickname
localChar:SetNickNames(nickNames)
client:Notify((nickname and "Assigned" or "Removed").." nickname "..(!nickname and "" or "'"..nickname.."'")..(nickname and " to" or "from").." this character.")
end