mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-02 00:42:29 +00:00
init
This commit is contained in:
29
lua/entities/gmod_train_sound_provider/init.lua
Normal file
29
lua/entities/gmod_train_sound_provider/init.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
util.AddNetworkString("TrackController")
|
||||
local function ShowWindowOnCL(ply,ent)
|
||||
net.Start("TrackController")
|
||||
net.WriteEntity(ent)
|
||||
net.Send(ply)
|
||||
end
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/metrostroi/signals/clock_time.mdl")
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
end
|
||||
function ENT:SpawnFunction( ply, tr, ClassName )
|
||||
|
||||
if ( !tr.Hit ) then return end
|
||||
|
||||
local SpawnPos = tr.HitPos + tr.HitNormal * 16
|
||||
local ent = ents.Create( ClassName )
|
||||
ent:SetPos( SpawnPos )
|
||||
ent:Spawn()
|
||||
ent:Activate()
|
||||
|
||||
ShowWindowOnCL(ply,ent)
|
||||
return ent
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user