Raised This Month: $12 Target: $400
 3% 

[ZP] Custom lights


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Welgericht
Member
Join Date: Jul 2010
Old 12-13-2010 , 09:10   [ZP] Custom lights
Reply With Quote #1

Custom Lights

Plugin: [ZP] Custom Lights
Version: 1.0 (beta)
Author: Doomday (aka Weltgericht)

Description:
This plugin allows you to use different lights for different mods.

Modules
PHP Code:
#include < amxmodx >

#include < zombieplague >
#include < engine > 
Cvars
PHP Code:
    cvars[infection]  =    register_cvar("zp_lights_infection""c");  
    
cvars[nemesis]    =    register_cvar("zp_lights_nemesis""a");  
    
cvars[survivor]   =    register_cvar("zp_lights_survivor""z");
    
cvars[swarm]      =    register_cvar("zp_lights_swarm""b");
    
cvars[multi]      =    register_cvar("zp_lights_multi""d");
    
cvars[plague]     =    register_cvar("zp_lights_plague""b");

// Lights at specified mod
// a - very dark 
// z - very bright 
Download:
Attached Files
File Type: sma Get Plugin or Get Source (zp_lights.sma - 650 views - 1.2 KB)

Last edited by Welgericht; 12-13-2010 at 11:33.
Welgericht is offline
Merry Christmas
Member
Join Date: Oct 2010
Old 12-13-2010 , 11:21   Re: [ZP] Custom lights
Reply With Quote #2

Awesome plugin!! Thanks!
Merry Christmas is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-13-2010 , 12:22   Re: [ZP] Custom lights
Reply With Quote #3

Its already been made:
http://forums.alliedmods.net/showthread.php?t=117143
And its much betterly coded than yours
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
mehmetali
Senior Member
Join Date: Jan 2010
Location: Turkey
Old 12-13-2010 , 12:22   Re: [ZP] Custom lights
Reply With Quote #4

useful
mehmetali is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-13-2010 , 22:23   Re: [ZP] Custom lights
Reply With Quote #5

this is better than yours abdul!
__________________
jc980 is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-14-2010 , 02:38   Re: [ZP] Custom lights
Reply With Quote #6

This is his code
Code:
#include < amxmodx > #include < zombieplague > #include < engine > #define PLUGIN  "[ZP] Custom lights" #define VERSION "1.0" #define AUTHOR  "Doomsday" enum cvar {     infection,     nemesis,     survivor,     swarm,     multi,     plague } new cvars[cvar] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     cvars[infection]  = register_cvar("zp_lights_infection", "c");     cvars[nemesis]    = register_cvar("zp_lights_nemesis", "a");     cvars[survivor]   = register_cvar("zp_lights_survivor", "z");     cvars[swarm]      = register_cvar("zp_lights_swarm", "b");     cvars[multi]      = register_cvar("zp_lights_multi", "d");     cvars[plague]     = register_cvar("zp_lights_plague", "b"); } public zp_round_started (GameMode, id) {     if(GameMode == MODE_INFECTION)     {         set_lights("get_pcvar_string(cvars[infection])")     }     else if(GameMode == MODE_NEMESIS)     {         set_lights("get_pcvar_string(cvars[nemesis])")     }     else if(GameMode == MODE_SURVIVOR)     {         set_lights("get_pcvar_string(cvars[survivor])")     }     else if(GameMode == MODE_SWARM)     {         set_lights("get_pcvar_string(cvars[swarm])")     }     else if(GameMode == MODE_MULTI)     {         set_lights("get_pcvar_string(cvars[multi])")     }     else if(GameMode == MODE_PLAGUE)     {         set_lights("get_pcvar_string(cvars[multi])")     } }

And this is mine, which also haves more features:
Code:
#include <amxmodx> #include <zombieplague> // Used in indexing the cvar #define ROUND_START 0 // Global Variables new cvar_light[ MODE_PLAGUE + 1 ] new cvar_plugin_on, cvar_pointer_lighting public plugin_init( ) {     // Register the plugin and some natives     register_plugin( "[ZP] Lightings At Start", "1.1", "@bdul!" )     register_event( "HLTV", "event_round_start", "a", "1=0", "2=0" )         // Register some cvars     cvar_plugin_on =       register_cvar( "zp_lights_at_start" , "1" )     cvar_light[ ROUND_START ] =     register_cvar( "zp_starting_lights" , "f" )     cvar_light[ MODE_INFECTION ] =  register_cvar( "zp_infection_lighting" , "a" )     cvar_light[ MODE_NEMESIS ] =    register_cvar( "zp_nem_lighting" , "m" )     cvar_light[ MODE_SURVIVOR ] =   register_cvar( "zp_surv_lighting" , "b" )     cvar_light[ MODE_SWARM ] =  register_cvar( "zp_swarm_lighting" , "c" )     cvar_light[ MODE_MULTI ] =  register_cvar( "zp_multi_lighting" , "d" )     cvar_light[ MODE_PLAGUE ] =     register_cvar( "zp_plague_lighting" , "a" )     cvar_pointer_lighting = get_cvar_pointer( "zp_lighting" ) } // Set the lighting level on round start public event_round_start( ) {     // Make sure the plugin is on !     if ( get_pcvar_num( cvar_plugin_on ) )     {         // Retrieve the value at which the lighting will be set         static sz_starting_lights[ 2 ]         get_pcvar_string( cvar_light[ ROUND_START ], sz_starting_lights, charsmax( sz_starting_lights ) )                 // Set the lighting level         if ( sz_starting_lights[ 0 ] ) set_pcvar_string( cvar_pointer_lighting, sz_starting_lights )     } } // Set the lighting level after a mode starts public zp_round_started( mode, unused ) {     // Make sure its a valid mode     if ( !( MODE_INFECTION <= mode <= MODE_PLAGUE ) )         return;     // Make sure the plugin is on !     if ( get_pcvar_num( cvar_plugin_on ) )     {         // Retrieve the value at which the lighting will be set         static sz_mode_lights[ 2 ]         get_pcvar_string( cvar_light[ mode ], sz_mode_lights, charsmax( sz_mode_lights ) )                 // Set the lighting level         if ( sz_mode_lights[ 0 ] ) set_pcvar_string( cvar_pointer_lighting, sz_mode_lights )     } }
You can now see which is better and by the way his plugin wont even work cause of this
PHP Code:
set_lights("get_pcvar_string(cvars[swarm])"
He is setting the cvar inside the string which wont work
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-14-2010 , 02:58   Re: [ZP] Custom lights
Reply With Quote #7

tested it?
__________________
jc980 is offline
Welgericht
Member
Join Date: Jul 2010
Old 12-14-2010 , 08:53   Re: [ZP] Custom lights
Reply With Quote #8

Haw can it be done by another way?
Welgericht is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-14-2010 , 09:02   Re: [ZP] Custom lights
Reply With Quote #9

look into my plugin
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Reply


Thread Tools
Display Modes

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 10:34.


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