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,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("Surnom : "..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 = "Implémente les surnoms possibles pour les individus non masqués/non masqués."
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, "Le nombre maximum de caractères pour un surnom attribué.", nil,
{data = {min = 1, max = 60}, category = "Nicknames"}
)
ix.command.Add("SetNickname", {
description = "Attribuez un surnom à une personne non masquée.",
arguments = {
ix.type.string
},
OnRun = function(self, client, nickname)
if (SERVER) then
PLUGIN:SetNickName(client, nickname)
end
end
})
ix.command.Add("RemoveNickname", {
description = "Supprime un surnom ajouté à un individu non masqué.",
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("Ce surnom est trop court !")
return
end
if string.len(nickname) > ix.config.Get("maxNicknameLength", 40) then
client:Notify("Ce surnom est trop long !")
return
end
end
local target = client:GetEyeTraceNoCursor().Entity
if (!IsValid(target) or !(target:IsPlayer() or target:GetClass() == "prop_ragdoll")) then
client:Notify("Vous devez regarder une cible valide !")
return
end
if target:GetNetVar("ixMaskEquipped") then
client:Notify("Vous ne pouvez pas attribuer de surnoms à des personnes masquées !")
return false
end
if target:GetNetVar("combineMaskEquipped") then
client:Notify("Vous ne pouvez pas attribuer de surnoms à des personnes masquées !")
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 "Attribué" or "Supprimé").." surnom "..(!nickname and "" or "'"..nickname.."'")..(nickname and " pour" or "de").." ce personnage.")
end