mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
ENT.PopulateEntityInfo = true
|
||||
|
||||
function ENT:OnPopulateEntityInfo(container)
|
||||
local time = StormFox2 and ix.date.GetFormatted(StormFox2.Time.TimeToString()) or ix.date.GetFormatted("%H:%M")
|
||||
local lastTime = self:GetNetVar("lastTime")
|
||||
|
||||
local description = container:AddRow("description")
|
||||
description:SetFont("TitlesFontNoClamp")
|
||||
description:SetText(self:GetNetVar("enabled") and time or lastTime)
|
||||
description:SizeToContents()
|
||||
end
|
||||
@@ -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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetNetVar("enabled", true)
|
||||
self:SetNetVar("lastTime", 0)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use()
|
||||
local isEnabled = self:GetNetVar("enabled")
|
||||
self:EmitSound("buttons/lightswitch2.wav")
|
||||
|
||||
if (isEnabled) then
|
||||
self:SetNetVar("lastTime", StormFox2 and ix.date.GetFormatted(StormFox2.Time.TimeToString()) or ix.date.GetFormatted("%H:%M"))
|
||||
self:SetNetVar("enabled", false)
|
||||
else
|
||||
self:SetNetVar("enabled", true)
|
||||
self:SetNetVar("lastTime", nil)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Clock"
|
||||
ENT.Spawnable = false
|
||||
ENT.bNoPersist = true
|
||||
@@ -0,0 +1,30 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Think()
|
||||
if (self:GetNetVar("enabled")) then
|
||||
local light = DynamicLight(self:EntIndex())
|
||||
local data = PLUGIN.usableEntityLookup[string.lower(self:GetModel())] -- I should optimize this...
|
||||
|
||||
light.pos = self:GetPos() + (self:GetUp() * (data.upOffset or 1)) + (self:GetForward() * (data.forwardOffset or 1))
|
||||
light.r = data.color.r
|
||||
light.g = data.color.g
|
||||
light.b = data.color.b
|
||||
light.brightness = 1
|
||||
light.Decay = 1000
|
||||
light.Size = data.lightSize
|
||||
light.DieTime = CurTime() + 1
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self:SetNetVar("enabled", false)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use()
|
||||
local data = PLUGIN.usableEntityLookup[string.lower(self:GetModel())]
|
||||
|
||||
self:EmitSound(data.sound or "buttons/lightswitch2.wav")
|
||||
self:SetNetVar("enabled", !self:GetNetVar("enabled"))
|
||||
|
||||
if (data.changeSkin) then
|
||||
self:SetSkin(self:GetNetVar("enabled") and 1 or 0)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Lamp"
|
||||
ENT.Spawnable = false
|
||||
ENT.bNoPersist = true
|
||||
@@ -0,0 +1,12 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/sleepjie/opensign2.mdl")
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetCollisionGroup(COLLISION_GROUP_NONE)
|
||||
|
||||
self:SetSkin(1)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if IsValid(physObj) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use()
|
||||
self:ToggleState()
|
||||
end
|
||||
|
||||
function ENT:ToggleState()
|
||||
local state = not self.enabled
|
||||
self.enabled = state
|
||||
self:SetSkin(state and 0 or 1)
|
||||
self:EmitSound("buttons/lightswitch2.wav")
|
||||
end
|
||||
@@ -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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Shop Sign"
|
||||
ENT.Category = "HL2 RP"
|
||||
ENT.Spawnable = true
|
||||
ENT.bNoPersist = true
|
||||
@@ -0,0 +1,12 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
@@ -0,0 +1,90 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if (IsValid(physObj)) then
|
||||
physObj:EnableMotion(false)
|
||||
physObj:Sleep()
|
||||
end
|
||||
|
||||
ix.inventory.New(0, "toilet", function(inventory)
|
||||
if (!IsValid(self)) then return end
|
||||
|
||||
if (inventory) then
|
||||
inventory.vars.isBag = true
|
||||
|
||||
self:SetNetVar("ID", inventory:GetID())
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:OnOptionSelected(client, option, data)
|
||||
if (option == "Ouvrir") then
|
||||
local inventory = ix.item.inventories[self:GetNetVar("ID")]
|
||||
|
||||
if (inventory) then
|
||||
ix.storage.Open(client, inventory, {
|
||||
name = "Toilette",
|
||||
entity = self,
|
||||
searchTime = 1
|
||||
})
|
||||
end
|
||||
elseif (option == "Chasse d'eau") then
|
||||
if (self.nextFlush or 0) < CurTime() then
|
||||
self.nextFlush = CurTime() + 7
|
||||
|
||||
local inventory = ix.item.inventories[self:GetNetVar("ID")]
|
||||
|
||||
if (inventory) then
|
||||
for _, item in pairs(inventory:GetItems()) do
|
||||
item:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
self:EmitSound("ambient/machines/usetoilet_flush1.wav", nil, math.random(90, 110))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:OnRemove()
|
||||
if (!ix.shuttingDown) then
|
||||
local index = self:GetNetVar("ID")
|
||||
|
||||
if (!self.ixIsSafe and ix.entityDataLoaded and index) then
|
||||
local inventory = index != 0 and ix.item.inventories[index]
|
||||
|
||||
if (inventory) then
|
||||
ix.item.inventories[index] = nil
|
||||
|
||||
local query = mysql:Delete("ix_items")
|
||||
query:Where("inventory_id", index)
|
||||
query:Execute()
|
||||
|
||||
query = mysql:Delete("ix_inventories")
|
||||
query:Where("inventory_id", index)
|
||||
query:Execute()
|
||||
|
||||
hook.Run("ContainerRemoved", self, inventory)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Toilette"
|
||||
ENT.Spawnable = false
|
||||
ENT.bNoPersist = true
|
||||
|
||||
function ENT:GetEntityMenu(client)
|
||||
return {["Ouvrir"] = true, ["Chasse d'eau"] = true}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user