1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00
This commit is contained in:
g_brzhezinskiy
2021-01-02 12:51:45 +03:00
commit 1d05caf866
613 changed files with 337020 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
include("shared.lua")
--------------------------------------------------------------------------------
ENT.ClientProps = {}
ENT.ButtonMap = {}
--------------------------------------------------------------------------------
ENT.ClientPropsInitialized = false
--------------------------------------------------------------------------------
-- Add doors
local function GetDoorPosition(i,k,j)
if j == 0
then return Vector(347.5 - 32*k - 230*i,-65*(1-2*k),-2.8)
else return Vector(347.5 - 32*(1-k) - 230*i,-65*(1-2*k),-2.8)
end
end
for i=0,3 do
for k=0,1 do
ENT.ClientProps["door"..i.."x"..k.."a"] = {
model = "models/metrostroi/81/81-7036_door1.mdl",
pos = GetDoorPosition(i,k,0),
ang = Angle(0,180*(1-k),0)
}
ENT.ClientProps["door"..i.."x"..k.."b"] = {
model = "models/metrostroi/81/81-7036_door2.mdl",
pos = GetDoorPosition(i,k,1),
ang = Angle(0,180*(1-k),0)
}
end
end
table.insert(ENT.ClientProps,{
model = "models/metrostroi/81/81-7036_door4.mdl",
pos = Vector(-487.0,-2.2,-4.5),
ang = Angle(0,0,0)
})
table.insert(ENT.ClientProps,{
model = "models/metrostroi/81/81-7036_door4.mdl",
pos = Vector(461.0,1.2,-4.5),
ang = Angle(0,180,0)
})
--------------------------------------------------------------------------------
function ENT:Think()
self.BaseClass.Think(self)
end
function ENT:Draw()
self.BaseClass.Draw(self)
end

View File

@@ -0,0 +1,38 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.BogeyDistance = 650 -- Needed for gm trainspawner
---------------------------------------------------
-- Defined train information
-- Types of wagon(for wagon limit system):
-- 0 = Head or intherim
-- 1 = Only head
-- 2 = Only intherim
---------------------------------------------------
ENT.SubwayTrain = {
Type = "81",
Name = "81-7037",
WagType = 2,
Manufacturer = "KVZ",
}
function ENT:Initialize()
-- Set model and initialize
self:SetModel("models/metrostroi/81/81-7037.mdl")
self.BaseClass.Initialize(self)
self:SetPos(self:GetPos() + Vector(0,0,140))
-- Create bogeys
self.FrontBogey = self:CreateBogey(Vector( 325-20,0,-80),Angle(0,180,0),true)
self.RearBogey = self:CreateBogey(Vector(-325-10,0,-80),Angle(0,0,0),false)
end
--------------------------------------------------------------------------------
function ENT:Think()
local retVal = self.BaseClass.Think(self)
return retVal
end

View File

@@ -0,0 +1,24 @@
ENT.Type = "anim"
ENT.Base = "gmod_subway_base"
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Category = "Metrostroi (trains)"
ENT.Spawnable = false --NOT FINISHED
ENT.AdminSpawnable = false --NOT FINISHED
function ENT:PassengerCapacity()
return 300
end
function ENT:GetStandingArea()
return Vector(-450,-30,-45),Vector(380,30,-45)
end
function ENT:InitializeSystems()
self:LoadSystem("KK","Relay","Switch")
self:LoadSystem("Pneumatic","81_717_Pneumatic")
end