Raised This Month: $ Target: $400
 0% 

Day/Night Effect V1.3


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-18-2010 , 22:16   Re: Effect Day/Night V1.2
Reply With Quote #7

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".

Last edited by Emp`; 11-18-2010 at 22:19.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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