mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
29
gamemodes/helix/plugins/propdescriptions/cl_hooks.lua
Normal file
29
gamemodes/helix/plugins/propdescriptions/cl_hooks.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
function PLUGIN:PopulateEntityInfo(entity, container)
|
||||
if (entity:GetClass() != "prop_physics") then return end
|
||||
|
||||
local propDescription = entity:GetNetVar("description")
|
||||
|
||||
if (!propDescription or !istable(propDescription) or #propDescription != 2) then return end
|
||||
|
||||
local titleLabel = container:AddRow("titre")
|
||||
titleLabel:SetText(propDescription[1])
|
||||
titleLabel:SetImportant()
|
||||
titleLabel:SetBackgroundColor(Color(255, 255, 255, 255))
|
||||
titleLabel:SizeToContents()
|
||||
|
||||
local descriptionLabel = container:AddRow("description")
|
||||
descriptionLabel:SetText(propDescription[2])
|
||||
descriptionLabel:SetBackgroundColor(Color(255, 255, 255, 255))
|
||||
descriptionLabel:SizeToContents()
|
||||
end
|
||||
@@ -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 = {
|
||||
invalidProp = "Ce n'est pas un accessoire valide !",
|
||||
propNotYours = "Cet accessoire ne vous appartient pas !",
|
||||
propDescriptionAdded = "Description de l'accessoire ajoutée.",
|
||||
propDescriptionRemoved = "Description de l'accessoire supprimée."
|
||||
}
|
||||
@@ -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 = {
|
||||
invalidProp = "Ce n'est pas un accessoire valide !",
|
||||
propNotYours = "Cet accessoire ne vous appartient pas !",
|
||||
propDescriptionAdded = "Description de l'accessoire ajoutée.",
|
||||
propDescriptionRemoved = "Description de l'accessoire supprimée."
|
||||
}
|
||||
124
gamemodes/helix/plugins/propdescriptions/sh_commands.lua
Normal file
124
gamemodes/helix/plugins/propdescriptions/sh_commands.lua
Normal file
@@ -0,0 +1,124 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
do
|
||||
local COMMAND = {}
|
||||
COMMAND.description = "Ajoutez un texte décrivant un props spécifique."
|
||||
COMMAND.arguments = {ix.type.string, ix.type.text}
|
||||
COMMAND.alias = {"PropDescAdd"}
|
||||
|
||||
function COMMAND:OnRun(client, title, description)
|
||||
local curTime = CurTime()
|
||||
|
||||
if (client.nextStaticText and client.nextStaticText >= curTime) then
|
||||
client:NotifyLocalized("notNow")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (title == "" or description == "") then
|
||||
return
|
||||
end
|
||||
|
||||
local entity = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
|
||||
client:NotifyLocalized("invalidProp")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (client:SteamID() != entity.ownerSteamID and !client:IsAdmin()) then
|
||||
client:NotifyLocalized("propNotYours")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
client.nextStaticText = curTime + 5
|
||||
client:NotifyLocalized("propDescriptionAdded")
|
||||
|
||||
entity:SetNetVar("description", {title, description})
|
||||
|
||||
ix.log.Add(client, "propDescriptionAdded", title, description)
|
||||
end
|
||||
|
||||
ix.command.Add("PropDescriptionAdd", COMMAND)
|
||||
end
|
||||
|
||||
do
|
||||
local COMMAND = {}
|
||||
COMMAND.description = "Ajouter un texte permanent décrivant un props spécifique."
|
||||
COMMAND.arguments = {ix.type.string, ix.type.text}
|
||||
COMMAND.adminOnly = true
|
||||
COMMAND.alias = {"PermPropDescAdd"}
|
||||
|
||||
function COMMAND:OnRun(client, title, description)
|
||||
local curTime = CurTime()
|
||||
|
||||
if (client.nextStaticText and client.nextStaticText >= curTime) then
|
||||
client:NotifyLocalized("notNow")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (title == "" or description == "") then
|
||||
return
|
||||
end
|
||||
|
||||
local entity = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
|
||||
client:NotifyLocalized("invalidProp")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
client.nextStaticText = curTime + 5
|
||||
client:NotifyLocalized("propDescriptionAdded")
|
||||
|
||||
entity:SetNetVar("description", {title, description})
|
||||
entity.saveDescription = true
|
||||
|
||||
ix.log.Add(client, "propDescriptionAdded", title, description)
|
||||
end
|
||||
|
||||
ix.command.Add("PermanentPropDescriptionAdd", COMMAND)
|
||||
end
|
||||
|
||||
do
|
||||
local COMMAND = {}
|
||||
COMMAND.description = "Supprime la description d'un props."
|
||||
COMMAND.alias = {"PropDescRemove"}
|
||||
|
||||
function COMMAND:OnRun(client)
|
||||
local entity = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
|
||||
client:NotifyLocalized("invalidProp")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (client:SteamID() != entity.ownerSteamID and !client:IsAdmin()) then
|
||||
client:NotifyLocalized("propNotYours")
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
client:NotifyLocalized("propDescriptionRemoved")
|
||||
|
||||
entity:SetNetVar("description", nil)
|
||||
|
||||
ix.log.Add(client, "propDescriptionRemoved")
|
||||
end
|
||||
|
||||
ix.command.Add("PropDescriptionRemove", COMMAND)
|
||||
end
|
||||
18
gamemodes/helix/plugins/propdescriptions/sh_plugin.lua
Normal file
18
gamemodes/helix/plugins/propdescriptions/sh_plugin.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
PLUGIN.name = "Prop Descriptions"
|
||||
PLUGIN.author = "Aspect™"
|
||||
PLUGIN.descriptions = "Permet aux joueurs de définir des descriptions pour les props."
|
||||
|
||||
ix.util.Include("cl_hooks.lua")
|
||||
ix.util.Include("sh_commands.lua")
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
18
gamemodes/helix/plugins/propdescriptions/sv_plugin.lua
Normal file
18
gamemodes/helix/plugins/propdescriptions/sv_plugin.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
--[[
|
||||
| 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.log.AddType("propDescriptionAdded", function(client, title, description)
|
||||
return string.format("%s a défini une description de props : '%s' - '%s'.", client:GetName(), title, description)
|
||||
end)
|
||||
|
||||
ix.log.AddType("propDescriptionRemoved", function(client)
|
||||
return string.format("%s a supprimé une description de props :", client:GetName())
|
||||
end)
|
||||
Reference in New Issue
Block a user