AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Day/Night Effect V1.3 (https://forums.alliedmods.net/showthread.php?t=143313)

Destro- 11-17-2010 22:42

Day/Night Effect V1.3
 
2 Attachment(s)
--=Day/Night Effect 1.3=--

Discripcion:
Change the light and sky of map,according to the time.

Credits:
Gladius Idea

Changelogs:
1.1:Add Lights
1.2: Existent file check
1.3: Optimization,Dynamic configuration

Cvars:
amx_dn_sky_on // on/off changing sky
amx_dn_lights_on // on/off light change

sky register:
Create a file ". Ini." skys the name.

Code:

;sky.ini
[sky 1]
hour:0,5
sky_name:space
lights_level:b
 
[sky 2]
hour:6,8
sky_name:space
lights_level:c
 
[sky 3]
hour:9,10
sky_name:space
lights_level:d
 
[sky 4]
hour:11,17
sky_name:des
lights_level:off
 
[sky 5]
hour:18,20
sky_name:des
lights_level:d
 
[sky 6]
hour:21,23
sky_name:space
lights_level:c


Sorry for my English, I use translator.
Someone would be so kind as to correct the translation.
Thanks

milu 11-17-2010 23:11

Re: Effect Day/Night V1.1
 
Good!

ConnorMcLeod 11-18-2010 02:10

Re: Effect Day/Night V1.1
 
Quote:

Originally Posted by Destro- (Post 1351656)
Warning:
If the sky is invalid they may cause server crash:(.

Then, check if sky is a default sky, or if files exist.

Destro- 11-18-2010 08:59

Re: Effect Day/Night V1.1
 
Quote:

Originally Posted by ConnorMcLeod
Then, check if sky is a default sky, or if files exist.

Thanks
@EDIT
Updated

S34Qu4K3 11-18-2010 10:41

Re: Effect Day/Night V1.2
 
Nice Destro! GJ :P

Destro- 11-18-2010 14:50

Re: Effect Day/Night V1.2
 
There is something to optimize?

Emp` 11-18-2010 22:16

Re: Effect Day/Night V1.2
 
Code:

                        num_str_sky = "1"
                        g_lights_level = "a"

This is a poor way to copy a string. Please use the copy native.

Code:

                case 0..4: {
                        num_str_sky = "1"
                        g_lights_level = "a"
                }
//....
                case 23: {
                        num_str_sky = "1"
                        g_lights_level = "a"
                }

This can be shortened to:
Code:

                case 0..4,23: {
                        num_str_sky = "1"
                        g_lights_level = "a"
                }

Instead of doing this:
Code:

                                g_skyname[0] = ' '
                                g_skyname[1] = ' '
                                trim(g_skyname)

Look into: String Slicing.

The function set_effect does not need to be public.

Should use log_amx instead of log_to_file.

Instead of using a variable sky_load on line 122, you could simply check if g_skyname is empty or not.

You could also attempt to move the functions load_sky and set_effect into plugin_precache, assuming that you can alter sv_skyname and use set_lights during that time, instead of during plugin_init.

You use charsmax in several spots, would be better if you used it throughout the plugin.

Also work on your whitespace. People prefer lines like this:
Code:

if(!file_exists(file)){
to look like this:
Code:

if ( !file_exists( file ) )
{

Though that is stylistic.

Suggestions:
Have the plugin check every hour for what sky should be present. (Some servers remain on a map for longer than an hour)
Allow the skys.ini to specify a sky for certain hours, and not your 1 to 6 method.
Also allow skys.ini to specify a light level for the matching sky.
I would personally rename the plugin something along the lines of "hourly", "skys" and "lights".

Destro- 11-20-2010 00:02

Re: Effect Day/Night V1.2
 
Quote:

Originally Posted by Emp` (Post 1352174)
I would personally rename the plugin something along the lines of "hourly", "skys" and "lights".

?

pd:
Quote:

Originally Posted by Destro- (Post 1351812)
Updated

:|

Leon_12 11-20-2010 05:42

Re: Effect Day/Night V1.3
 
change the version in .sma code because it's 1.1 i see the plugin is 1.3

Destro- 11-20-2010 07:49

Re: Effect Day/Night V1.3
 
In a hurry.:(

xgam3r1 11-21-2010 04:54

Re: Effect Day/Night V1.3
 
i see a fault in the idea of this plugin... You probably have people from different time zones that play in your server :twisted:

Destro- 11-21-2010 10:41

Re: Effect Day/Night V1.3
 
Also thetime.And many other plugins

s3rserii 02-08-2011 09:12

Re: Effect Day/Night V1.3
 
where can i find the normal skynames with a preview. or without preview :)

Emp` 02-08-2011 15:31

Re: Effect Day/Night V1.3
 
Approved. Sorry for the delay.

Destro- 02-09-2011 09:43

Re: Effect Day/Night V1.3
 
Thanks :).

Today was a good day,new session in Spanish.

s3rserii 02-11-2011 14:35

Re: Effect Day/Night V1.3
 
Quote:

Originally Posted by s3rserii (Post 1410041)
where can i find the normal skynames with a preview. or without preview :)

nobody? :/

Storms 04-18-2011 12:23

Re: Day/Night Effect V1.3
 
^ Go to your cstrike/gfx/env folder, all skies are in there. Each sky has 6 images, one for each side of the box, with different 2-letter suffixes. When typing the sky name, ignore these suffixes. E.g: for backalleybk.tga, backalleydn.tga, backalleyft.tga (...), the name is backalley.

bibu 05-15-2011 05:34

Re: Day/Night Effect V1.3
 
Can we also use:

sky_name: off

So it will use the maps itself sky?

AntonioLima4 11-17-2011 09:30

Re: Day/Night Effect V1.3
 
Hmm.. :DD It could be better!

But it's good anyway... -_-'

simple_user 04-09-2012 12:09

Re: Effect Day/Night V1.3
 
Quote:

Originally Posted by s3rserii (Post 1412808)
nobody? :/


Sky textures:
here > http://www.kk3d.de/counter-strike/skies/index.htm

SyluxLockjaw100 05-28-2012 15:08

Re: Day/Night Effect V1.3
 
Weather effects would be nice too :)

ZiTnO_O 08-26-2012 12:27

Re: Day/Night Effect V1.3
 
Quote:

Originally Posted by ZiTnO_O (Post 1783185)
hi! everyone :) ..
I am using [SIZE="6"][B]--=Day/Night Effect 1.3=--[/B][/SIZE] plugin (is really good) [B].. but its a bit dark as you can see !! [/B]

[IMG]http://img542.**************/img542/2966/95233530.jpg[/IMG]

[B]so is there is any other plugin of Lamps or anything I can add !! [/B]

HELP!!

ZiTnO_O 08-26-2012 12:30

Re: Day/Night Effect V1.3
 
Quote:

Originally Posted by SyluxLockjaw100 (Post 1718259)
Weather effects would be nice too :)

lol :P try this one

RainySnowy 2.0y

SkumTomteN 01-01-2014 15:58

Re: Day/Night Effect V1.3
 
And how do i make this work?. nothing is changing, is the clock the time in-game?. do u have to set timelimit on round to 19 min. or is it timelimit on map?. dont get it.

ANTICHRISTUS 01-10-2014 09:21

Re: Day/Night Effect V1.3
 
apparently, it's using the time of the machine where the server (HLDS) is hosted. if it's not working for you.. maybe the new updates disabled something or the problem is in your server versions and installed plugins.

alencore 03-13-2015 07:34

Re: Day/Night Effect V1.3
 
Here's a video demoing this very cool plugin. Set the night effect not too dark. hours past by the seconds only so as to show the day to night effect much faster.
https://www.youtube.com/watch?v=extE9JMhi_k

man_s_our 04-01-2018 18:10

Re: Day/Night Effect V1.3
 
Quote:

Originally Posted by SyluxLockjaw100 (Post 1718259)
Weather effects would be nice too :)

I'm working on winds plugin
but now it's without visual effects

Mikaeel123 05-01-2020 14:26

Re: Day/Night Effect V1.3
 
Hello . its nice plugin but it for 1 round . i use it in my jailbreak server . when round end we have no night in server . how i can add this always night ?

DJEarthQuake 05-02-2020 22:33

Re: Day/Night Effect V1.3
 
This plugin does not have it from what I can see. Night can be permanent in other plugins. Element is one.


All times are GMT -4. The time now is 09:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.