Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RealTimeLight()
- osdate = tostring(os.date(Ec))
- time = string.sub(osdate, -8 )
- if time == "00:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "b")
- PlaceLights()
- end
- if time == "00:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "c")
- PlaceLights()
- end
- if time == "01:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "d")
- PlaceLights()
- end
- if time == "01:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "e")
- PlaceLights()
- end
- if time == "02:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "f")
- PlaceLights()
- end
- if time == "02:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "g")
- PlaceLights()
- end
- if time == "03:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "h")
- PlaceLights()
- end
- if time == "03:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "i")
- PlaceLights()
- end
- if time == "04:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "j")
- PlaceLights()
- end
- if time == "04:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "k")
- PlaceLights()
- end
- if time == "05:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "l")
- PlaceLights()
- end
- if time == "05:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "m")
- PlaceLights()
- end
- if time == "06:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "n")
- PlaceLights()
- end
- if time == "06:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "o")
- PlaceLights()
- end
- if time == "07:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "p")
- PlaceLights()
- end
- if time == "07:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "q")
- PlaceLights()
- end
- if time == "08:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "r")
- PlaceLights()
- end
- if time == "08:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "s")
- PlaceLights()
- end
- if time == "09:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "t")
- PlaceLights()
- end
- if time == "09:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "u")
- PlaceLights()
- end
- if time == "10:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "v")
- PlaceLights()
- end
- if time == "10:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "w")
- PlaceLights()
- end
- if time == "11:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "x")
- PlaceLights()
- end
- if time == "11:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "y")
- PlaceLights()
- end
- if time == "12:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "z")
- PlaceLights()
- end
- if time == "12:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "y")
- PlaceLights()
- end
- if time == "13:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "x")
- PlaceLights()
- end
- if time == "13:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "w")
- PlaceLights()
- end
- if time == "14:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "v")
- PlaceLights()
- end
- if time == "14:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "u")
- PlaceLights()
- end
- if time == "15:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "t")
- PlaceLights()
- end
- if time == "16:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "s")
- PlaceLights()
- end
- if time == "16:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "r")
- PlaceLights()
- end
- if time == "17:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "q")
- PlaceLights()
- end
- if time == "17:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "p")
- PlaceLights()
- end
- if time == "18:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "o")
- PlaceLights()
- end
- if time == "18:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "n")
- PlaceLights()
- end
- if time == "19:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "m")
- PlaceLights()
- end
- if time == "19:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "l")
- PlaceLights()
- end
- if time == "20:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "k")
- PlaceLights()
- end
- if time == "20:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "j")
- PlaceLights()
- end
- if time == "21:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "i")
- PlaceLights()
- end
- if time == "21:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "h")
- PlaceLights()
- end
- if time == "22:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "g")
- PlaceLights()
- end
- if time == "22:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "f")
- PlaceLights()
- end
- if time == "23:00:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "e")
- PlaceLights()
- end
- if time == "23:30:00" then
- RunConsoleCommand("es_lightstyle", "0", " ", "d")
- PlaceLights()
- end
- end
- hook.Add("Think", "HookRealTimeLight", RealTimeLight)
- function PlaceLights()
- local dynlightp = ents.Create("prop_physics")
- dynlightp:SetPos( Vector(0,0,0) )
- dynlightp:SetModel( "models/items/combine_rifle_ammo01.mdl" )
- dynlightp:Spawn()
- local dynlight = ents.Create( "light_dynamic" )
- dynlight:SetKeyValue( "_light", "0 0 0 0")
- dynlight:SetKeyValue( "style", 0 )
- dynlight:SetKeyValue( "distance", 16000 )
- dynlight:SetKeyValue( "brightness", 0 )
- --dynlight:SetKeyValue("spawnflags","2")
- dynlight:Spawn()
- dynlight:SetParent(dynlightp)
- if game.GetMap() == "gm_flatgrass" then
- timer.Simple(0.1, function() dynlightp:SetPos( Vector(0,0,100) ) end)
- timer.Simple(0.2, function() dynlight:SetKeyValue( "distance", 1000 ) dynlightp:SetPos( Vector(12271, -15343, 63) ) end)
- timer.Simple(0.3, function() dynlight:SetKeyValue( "distance", 5000 ) dynlightp:SetPos( Vector(-15412.406250, -8199.906250 , 63) ) end)
- timer.Simple(0.4, function() dynlight:SetKeyValue( "distance", 5000 ) dynlightp:SetPos( Vector(-14267.750000, 10165.625000 , 63) ) end)
- timer.Simple(0.5, function() dynlight:SetKeyValue( "distance", 1000 ) dynlightp:SetPos( Vector(-8899.781250, -14625.156250, 63.031250) ) end)
- timer.Simple(0.6, function() dynlight:SetKeyValue( "distance", 1000 ) dynlightp:SetPos( Vector(-14625.156250, -14625.156250, 63.031250) ) end)
- timer.Simple(0.7, function() dynlight:SetKeyValue( "distance", 1000 ) dynlightp:SetPos( Vector( 1434.218750, 758.375000, 123.093750) ) end)
- timer.Simple(0.9, function() dynlightp:Remove() end)
- end
- if game.GetMap() == "gm_construct" then
- timer.Simple(0.1, function() dynlight:SetKeyValue( "distance", 8000 ) dynlightp:SetPos( Vector(-520.375000, 2774.437500, 417.468750) ) end)
- timer.Simple(0.2, function() dynlight:SetKeyValue( "distance", 8000 ) dynlightp:SetPos( Vector(-2151.218750, -1235.093750, 4.156250) ) end)
- timer.Simple(0.3, function() dynlight:SetKeyValue( "distance", 8000 ) dynlightp:SetPos( Vector(1474.062500, 9.656250, -70.906250) ) end)
- timer.Simple(0.4, function() dynlight:SetKeyValue( "distance", 8000 ) dynlightp:Remove() end)
- end
- if game.GetMap() == "gm_flatgrass_revolution" then
- timer.Simple(0.1, function() dynlightp:SetPos( Vector(-24, 24, -7556) ) end)
- timer.Simple(0.2, function() dynlightp:SetPos( Vector(3416, -3804, -7834) ) end)
- timer.Simple(0.3, function() dynlightp:SetPos( Vector(-14008, -14333, -5952) ) end)
- timer.Simple(0.4, function() dynlightp:Remove() end)
- end
- if game.GetMap() == "freespace06_v2_snow_night1" then
- timer.Simple(0.1, function() dynlightp:SetPos( Vector(-49.875000, 30.156250, 609.343750) ) end)
- -- timer.Simple(0.2, function() dynlightp:SetPos( Vector(-1994.343750, -6153.500000, -3177.531250) ) end)
- timer.Simple(0.3, function() dynlightp:SetPos( Vector(-14008, -14333, -5952) ) end)
- timer.Simple(0.4, function() dynlightp:Remove() end)
- end
- timer.Simple(1, function() dynlightp:Remove() end)
- timer.Simple(1.1, function() dynlight:Remove() end)
- end
Advertisement
Add Comment
Please, Sign In to add comment