Raised This Month: $32 Target: $400
 8% 

[L4D] Glow (with pulse)


Post New Thread Reply   
 
Thread Tools Display Modes
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 07-29-2009 , 06:32   Re: [L4D] Glow (with pulse)
Reply With Quote #11

you can optimize your code.. and indent your code -.-
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Pontifex
Member
Join Date: Feb 2009
Old 07-29-2009 , 11:55   Re: [L4D] Glow (with pulse)
Reply With Quote #12

tuty
Why? What is the problem? Detailed description of the problem please
__________________
Sorry for my bad English
Pontifex is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-29-2009 , 16:42   Re: [L4D] Glow (with pulse)
Reply With Quote #13

Hold on pont, I'm modifying it to show you what he means.
Dragonshadow is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-29-2009 , 19:08   Re: [L4D] Glow (with pulse)
Reply With Quote #14

Can you make it so if the cvar is 0 it changes everything back to normal?

Thanks.
bman87 is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-30-2009 , 07:31   Re: [L4D] Glow (with pulse)
Reply With Quote #15

Quote:
Originally Posted by bman87 View Post
Can you make it so if the cvar is 0 it changes everything back to normal?

Thanks.
Shoot me a pm or make a post here with all the default glow values.
Dragonshadow is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-30-2009 , 10:33   Re: [L4D] Glow (with pulse)
Reply With Quote #16

Quote:
Originally Posted by Dragonshadow View Post
Shoot me a pm or make a post here with all the default glow values.
I don't know the default values. Also,

shouldnt
PHP Code:
public OnClientPutInServer(client)
    {    
    if (
client)
        {
            if(
GetConVarInt(MLGlow)==1
be

PHP Code:
public OnClientPutInServer(client)
    {    
    if (
client)
        {
            if(
GetConVarInt(MLGlow)>0
I have the ml_glow cvar set to 2 by default, it doesn't look like it will start the timers this way.

I agree that this code can be heavily optimized, I have disabled this plugin for now until this plugin is cleaned up.
bman87 is offline
Pontifex
Member
Join Date: Feb 2009
Old 07-30-2009 , 10:34   Re: [L4D] Glow (with pulse)
Reply With Quote #17

Quote:
Hold on pont, I'm modifying it to show you what he means.
What have you changed? Give the source =)
It is sometimes difficult to understand you. My English bad

Quote:
Can you make it so if the cvar is 0 it changes everything back to normal?
Yes. Version 1.2 release. BUT load on the server will still remain!
This can be rectified if the move if (GetConVarInt (MLGlow) to the timer
But then that would change the colors you will need to restart the map.
__________________
Sorry for my bad English

Last edited by Pontifex; 07-30-2009 at 10:43.
Pontifex is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-30-2009 , 10:45   Re: [L4D] Glow (with pulse)
Reply With Quote #18

Quote:
Originally Posted by Pontifex View Post
What have you changed? Give the source =)
It is sometimes difficult to understand you. My English bad


Yes. Version 1.2 release. BUT load on the server will still remain!
Thanks! But you still use way to many IF statements, you only need to use 1.

PHP Code:
if (GetConVarInt(MLGlow) == DEFAULT)        ClientCommand(client"cl_glow_item_far_b 1.0");
        if (
GetConVarInt(MLGlow) == DEFAULT)        ClientCommand(client"cl_glow_item_far_g 0.4");
        if (
GetConVarInt(MLGlow) == DEFAULT)        ClientCommand(client"cl_glow_item_far_r 0.3"); 
Should be

PHP Code:
if (GetConVarInt(MLGlow) == DEFAULT)
        {
            
ClientCommand(client"cl_glow_item_far_b 1.0");
            
ClientCommand(client"cl_glow_item_far_g 0.4");
            
ClientCommand(client"cl_glow_item_far_r 0.3");
        } 
bman87 is offline
Pontifex
Member
Join Date: Feb 2009
Old 07-30-2009 , 10:49   Re: [L4D] Glow (with pulse)
Reply With Quote #19

The habit
__________________
Sorry for my bad English
Pontifex is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-30-2009 , 10:55   Re: [L4D] Glow (with pulse)
Reply With Quote #20

Even better you can use a switch statement.

PHP Code:
switch (GetConVarInt(MLGlow))
        {
            case DEFAULT:
            {
                
ClientCommand(client"cl_glow_item_far_b 1.0");
                
ClientCommand(client"cl_glow_item_far_g 0.4");
                
ClientCommand(client"cl_glow_item_far_r 0.3");
            }
            case 
Q1:
            {
                
ClientCommand(client"cl_glow_item_far_r 0.5");
                
ClientCommand(client"cl_glow_item_far_g 1.0");
                
ClientCommand(client"cl_glow_item_far_b 0.0");
            }
            case 
D1:
            {
                
ClientCommand(client"cl_glow_item_far_r 0.0");
                
ClientCommand(client"cl_glow_item_far_b 1.0");
                
ClientCommand(client"cl_glow_item_far_g 0.6");
            }
        } 

Last edited by bman87; 07-30-2009 at 11:47.
bman87 is offline
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 03:01.


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