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,194 @@
--[[
| 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
ITEM.name = "Cigarette"
ITEM.description = "Une simple cigarette contenant du tabac, enroulé dans du papier fin et prête à être fumée.."
ITEM.model = Model("models/willardnetworks/cigarettes/cigarette.mdl")
ITEM.category = "Drogues"
ITEM.width = 1
ITEM.height = 1
ITEM.junkCleanTime = 120
if (CLIENT) then
function ITEM:PopulateTooltip(tooltip)
local length = self:GetData("length", 0)
local panel = tooltip:AddRowAfter("name", "remaining tobacco")
panel:SetBackgroundColor(derma.GetColor("Warning", tooltip))
panel:SetText("Tabac restant : "..(math.Round(math.Remap(length, 0, 1, 100, 0), 0)).."%")
panel:SizeToContents()
end
function ITEM:PaintOver(item, w, h)
local length = item:GetData("length", 0)
surface.SetDrawColor(length >= 1 and (Color(255, 110, 110, 100)) or (length < 1 and length != 0 and Color(255, 193, 110, 100)) or (Color(110, 255, 110, 100)))
surface.DrawOutlinedRect(1, 1, w - 2, h - 2)
end
end
function ITEM:GetModelFlexes()
return {[0] = self:GetData("length", 0)}
end
function ITEM:CreateCigarette(client)
if ( SERVER ) then
PLUGIN:CreateCigarette(self, client)
end
end
function ITEM:CheckIfModelAllowed(client)
local faceIndex = client:FindBodygroupByName("face")
if string.find(client:GetModel(), "models/willardnetworks/citizens/") then
local headIndex = client:FindBodygroupByName("head")
if client:GetBodygroup(faceIndex) == 1 or client:GetBodygroup(headIndex) == 4 then
return false
end
end
if string.find(client:GetModel(), "models/willardnetworks/vortigaunt.mdl") and client:GetBodygroup(faceIndex) == 1 then
return false
end
if string.find(client:GetModel(), "models/wn7new/metropolice/") and client:GetBodygroup(client:FindBodygroupByName("Cp_Head")) > 0 then
return false
end
for _, v in pairs(PLUGIN.allowedModels) do
if string.find(client:GetModel(), v) then return true end
end
return false
end
function ITEM:OnCanRunSmoke()
local client = self.player
local length = self:GetData("length", 0)
if length >= 1 then return false end
if client and !self:CheckIfModelAllowed(client) then return false end
if math.Round(math.Remap(length, 0, 1, 100, 0), 0) == 0 then return false end
if self.entity then return false end
if client and client.cigarette and IsValid(client.cigarette) then return false end
if !self.cigaretteEnt then return true end
return false
end
function ITEM:OnRunSmoke()
local client = self.player
if !client then return false end
if (!client:Alive()) then return false end
self:CreateCigarette(client)
client:NotifyLocalized("Vous avez inséré la cigarette dans votre bouche. Utilisez un briquet pour l'allumer.")
end
function ITEM:OnRunStopSmoke(client, value, bRemove)
client = client or self.player
if !client then return false end
if (!client:Alive()) then return false end
if (value and !bRemove) then
self:SetData("length", value)
end
if IsValid(self.cigaretteEnt) and IsEntity(self.cigaretteEnt) then
if !value and !bRemove then
local length = self.cigaretteEnt:GetFlexWeight(self.cigaretteEnt.flexIndexLength)
self:SetData("length", length)
end
self.cigaretteEnt:Remove()
client.cigarette = nil
end
self.cigaretteEnt = nil
client:NotifyLocalized(self:GetData("length") == 1 and "Vous avez fini de fumer la cigarette, il ne reste que le mégot." or "Vous avez enlevé la cigarette de votre bouche.")
local itemID = self:GetID()
if bRemove then
self:Remove()
end
netstream.Start(client, "CigaretteSetClientEntity", itemID, nil, nil)
end
function ITEM:OnCanRunStopSmoke()
local length = self:GetData("length", 0)
if length >= 1 then return false end
if math.Round(math.Remap(length, 0, 1, 100, 0), 0) == 0 then return false end
if self.cigaretteEnt and IsEntity(self.cigaretteEnt) then return true end
if self.player and !self:CheckIfModelAllowed(self.player) then return false end
return false
end
function ITEM:SmokingFinished(client, value)
self:OnRunStopSmoke(client, value, true)
end
function ITEM:OnTransferred(curInv, inventory)
local client = self.player
if client and client.cigarette and IsEntity(client.cigarette) and client.cigarette.cigaretteItem and client.cigarette.cigaretteItem == self then
self:OnRunStopSmoke()
end
end
ITEM.functions.smoke = {
name = "Placez dans la bouche",
tip = "Placez la cigarette dans votre bouche.",
icon = "icon16/brick_add.png",
OnRun = function(item)
item:OnRunSmoke()
return false
end,
OnCanRun = function(item)
if item:OnCanRunSmoke() then return true end
return false
end
}
ITEM.functions.stopsmoke = {
name = "Retirer de la bouche",
tip = "Retirez la cigarette de votre bouche/éteignez-la.",
icon = "icon16/brick_add.png",
OnRun = function(item)
item:OnRunStopSmoke()
return false
end,
OnCanRun = function(item)
if item:OnCanRunStopSmoke() then return true end
return false
end
}
if (CLIENT) then
netstream.Hook("CigaretteSetClientEntity", function(itemID, entIndex, isLit)
if itemID and ix.item.instances[itemID] then
ix.item.instances[itemID].cigaretteEnt = entIndex or nil
end
LocalPlayer().cigarette = entIndex or nil
if !LocalPlayer().cigarette then return end
LocalPlayer().cigarette.isLit = isLit or nil
end)
end

View File

@@ -0,0 +1,62 @@
--[[
| 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/
--]]
ITEM.name = "Lighter"
ITEM.base = "base_tools"
ITEM.category = "Outils"
ITEM.model = Model("models/willardnetworks/cigarettes/lighter.mdl")
ITEM.width = 1
ITEM.height = 1
ITEM.description = "Handheld device designed to spark a flame to light things on fire."
function ITEM:OnRunLight()
local client = self.player
if !client then return end
if !client:Alive() then return end
if client.cigarette and IsEntity(client.cigarette) and client.cigarette.cigaretteItem and
client.cigarette.cigaretteItem.GetID and ix.item.instances[client.cigarette.cigaretteItem:GetID()] then
client.cigarette.isLit = true
netstream.Start(client, "CigaretteSetClientEntity", client.cigarette.cigaretteItem:GetID(), client.cigarette, true)
end
client:NotifyLocalized("Vous commencez à fumer une cigarette.")
client:EmitSound(self.useSound)
self:DamageDurability(1)
end
function ITEM:OnCanRunLight()
local client = self.player
if !client then return end
if !client:Alive() then return end
if client.cigarette and !client.cigarette.isLit then return true end
return false
end
ITEM.functions.light = {
name = "Allumer une cigarette",
tip = "Allumer une cigarette",
icon = "icon16/brick_add.png",
OnRun = function(item)
item:OnRunLight()
return false
end,
OnCanRun = function(item)
if item:OnCanRunLight() then return true end
return false
end
}

View File

@@ -0,0 +1,13 @@
--[[
| 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/
--]]
ITEM.name = "Cigarette"
ITEM.description = "Une fine tige de papier enroulée sur elle-même, remplie d'un mélange de tabac finement coupé et d'autres substances, souvent enrobée d'un filtre en papier ou en cellulose. Lorsqu'allumée, elle produit de la fumée inhalée par l'utilisateur."

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/
--]]
ITEM.name = "Cigares Goodfella"
ITEM.category = "Drogues"
ITEM.model = Model("models/willardnetworks/cigarettes/cigarette_pack_goodfella.mdl")
ITEM.description = "Un paquet de cigares de haute qualité emballés dans du papier à tabac à grammage élevé contenant jusqu'à 8 cigares."
ITEM.allowNesting = true
ITEM.restriction = {"cigarette"}
ITEM.noEquip = true
function ITEM:OnBagInitialized(inventory)
inventory:Add("cigarette", 8)
end

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/
--]]
ITEM.name = "Paquet de cigarettes"
ITEM.model = Model("models/willardnetworks/cigarettes/cigarette_pack_1.mdl")
ITEM.category = "Drogues"
ITEM.description = "Le paquet de cigarettes est enveloppé d'un papier fin et doux au toucher, avec le motif de l'Union coloré. Sur la face avant, le logo de l'Union est imprimé en caractères gras et noirs, tandis que des avertissements sanitaires sont inscrits sur la face arrière. En le tenant dans votre main, vous pouvez sentir le poids léger du paquet, ainsi que l'odeur distincte et forte du tabac qui en émane."
ITEM.allowNesting = true
ITEM.restriction = {"cigarette"}
ITEM.noEquip = true
function ITEM:GetName()
return self:GetData("relabeled", false) and "Paquet de cigarettes réétiqueté" or "Paquet de cigarettes - Edition Bienfaiteur"
end
function ITEM:GetDescription()
return self:GetData("relabeled", false) and "Un paquet de cigarettes réétiqueté pouvant contenir précisément 8 cigarettes" or "Un paquet de cigarettes délivré par l'Union et pouvant contenir précisément 8 cigarettes"
end
function ITEM:GetModel()
return self:GetData("relabeled", false) and "models/willardnetworks/cigarettes/cigarette_pack_1.mdl" or "models/willardnetworks/cigarettes/cigarette_pack.mdl"
end
function ITEM:OnBagInitialized(inventory)
inventory:Add("cigarette", 8)
end

View File

@@ -0,0 +1,16 @@
--[[
| 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/
--]]
ITEM.name = "Briquet en plastique"
ITEM.model = Model("models/willardnetworks/cigarettes/lighter.mdl")
ITEM.description = "Un petit briquet en plastique avec une surface légèrement texturée pour une meilleure prise en main. Le couvercle s'ouvre facilement pour révéler une petite flamme prête à être allumée."
ITEM.useSound = "willardnetworks/cigarettes/normal.wav"
ITEM.category = "Outils"
ITEM.maxDurability = 8

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/
--]]
ITEM.name = "Briquet Zippo"
ITEM.model = Model("models/willardnetworks/cigarettes/zippo.mdl")
ITEM.description = "Le briquet Zippo est un classique intemporel. Avec son design élégant en métal, il est facilement reconnaissable grâce à son fameux 'clic' caractéristique. Il est simple à utiliser : il suffit d'ouvrir le capot, de frotter la pierre contre la molette et de regarder la flamme s'allumer. Pratique et élégant, c'est l'accessoire parfait pour les amateurs de cigares et les fumeurs de cigarettes."
ITEM.useSound = "willardnetworks/cigarettes/zippo.wav"
ITEM.maxDurability = 24
ITEM.width = 1
ITEM.height = 1
ITEM.iconCam = {
pos = Vector(-509.64, -427.61, 310.24),
ang = Angle(24.98, 400.03, 0),
fov = 0.29
}