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

[L4D] Glow (with pulse)


Post New Thread Reply   
 
Thread Tools Display Modes
Pontifex
Member
Join Date: Feb 2009
Old 07-30-2009 , 10:59   Re: [L4D] Glow (with pulse)
Reply With Quote #21

It's a good idea
so really better
__________________
Sorry for my bad English
Pontifex is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-30-2009 , 11:08   Re: [L4D] Glow (with pulse)
Reply With Quote #22

Is there a reason for so many timers? I think you should be able to do it with just two timers
bman87 is offline
Pontifex
Member
Join Date: Feb 2009
Old 07-30-2009 , 11:11   Re: [L4D] Glow (with pulse)
Reply With Quote #23

For convenience
The distribution by category

This causes additional strain on the server?
__________________
Sorry for my bad English
Pontifex is offline
bman87
Senior Member
Join Date: Dec 2008
Location: Michigan
Old 07-30-2009 , 11:50   Re: [L4D] Glow (with pulse)
Reply With Quote #24

Quote:
Originally Posted by Pontifex View Post
For convenience
The distribution by category

This causes additional strain on the server?
/* Use Comments */

I think it will cause a load on the server, since they repeat often.

Look at the plugin I posted below, I have not tested it. But it will compile.
Attached Files
File Type: sp Get Plugin or Get Source (mlglow.sp - 580 views - 7.1 KB)
bman87 is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-30-2009 , 17:39   Re: [L4D] Glow (with pulse)
Reply With Quote #25

Here is my version (incremented to 1.3)
It SHOULD work, but I don't have time to test it at the moment.

Changes:

Hooked glow cvar to glowhook so it isn't calling GetConvarInt every time the timer runs (optimization)

Uses switches instead of constant if statements (optimization)
Changed OnClientPutInServer to OnClientPostAdminCheck (they should be ingame at this point so nothing can screw up)
If ml_glow = 0 when a client joins it doesn't start the timers on them.

If client isn't connected and ingame the timers stop.
If the convar is changed to default (0) it sets the cvars back to default and then kills the timer so it isn't running just running (optimization)

When the cvar is changed to something other than 0 the timers will start again.

Added min & max values for ml_glow
Added version cvar "ml_version" for use as public cvar
Added description
Tweaked cvar description

Should work, again no guarantees.

If there are any errors, please post them.
Attached Files
File Type: sp Get Plugin or Get Source (mlglow2.sp - 539 views - 7.8 KB)

Last edited by Dragonshadow; 07-30-2009 at 17:43.
Dragonshadow is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 07-30-2009 , 21:30   Re: [L4D] Glow (with pulse)
Reply With Quote #26

Quote:
Originally Posted by Pontifex View Post
tuty
Why? What is the problem? Detailed description of the problem please
take it easy lol, i just said that because your code is hard to read.
__________________
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-31-2009 , 07:08   Re: [L4D] Glow (with pulse)
Reply With Quote #27

Dragonshadow
It works. Well done.
Added to the first post
Quote:
Added min & max values for ml_glow
Why is that?


Quote:
Originally Posted by tuty View Post
take it easy lol, i just said that because your code is hard to read.
my english bad, sorry )

***

I want to do what everyone can change the colors to your taste. Changing the color will be *.сfg
I tried to do but I can not.
For example:

This top
PHP Code:
new HandleGlowItemFarRed1 =INVALID_HANDLE;
new 
HandleGlowItemFarGreen1 =INVALID_HANDLE;
new 
HandleGlowItemFarBlue1 =INVALID_HANDLE;
new 
HandleGlowItemFarRed2 =INVALID_HANDLE;
new 
HandleGlowItemFarGreen2 =INVALID_HANDLE;
new 
HandleGlowItemFarBlue2 =INVALID_HANDLE
This is public OnPluginStart
PHP Code:
    AutoExecConfig(true"mlglow_config");

        
GlowItemFarRed1 CreateConVar("ml_glow_item_far_red_one""0.5"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarGreen1 CreateConVar("ml_glow_item_far_green_one""1.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarBlue1 CreateConVar("ml_glow_item_far_blue_one""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarRed2 CreateConVar("ml_glow_item_far_red_two""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarGreen2 CreateConVar("ml_glow_item_far_green_two""1.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarBlue2 CreateConVar("ml_glow_item_far_blue_two""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY); 
This is public Action: Glow1

PHP Code:
case 2//user
            
{
                
ClientCommand(client"cl_glow_item_far_b %d"GlowItemFarBlue1);
                
ClientCommand(client"cl_glow_item_far_g %d"GlowItemFarGreen1);
                
ClientCommand(client"cl_glow_item_far_r %d"GlowItemFarRed1);
            } 
This is public Action: Glow2
PHP Code:
case 2//user
            
{
                
ClientCommand(client"cl_glow_item_far_b %d"GlowItemFarBlue2);
                
ClientCommand(client"cl_glow_item_far_g %d"GlowItemFarGreen2);
                
ClientCommand(client"cl_glow_item_far_r %d"GlowItemFarRed2);
            } 
But I that does not properly do it, because nothing works
__________________
Sorry for my bad English

Last edited by Pontifex; 07-31-2009 at 07:59.
Pontifex is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-31-2009 , 08:02   Re: [L4D] Glow (with pulse)
Reply With Quote #28

Quote:
Originally Posted by Pontifex View Post
Dragonshadow
It works. Well done.
Added to the first post

Why is that?



my english bad, sorry )

***

I want to do what everyone can change the colors to your taste. Changing the color will be *.сfg
I tried to do but I can not.
For example:

This top
PHP Code:
new HandleGlowItemFarRed1 =INVALID_HANDLE;
new 
HandleGlowItemFarGreen1 =INVALID_HANDLE;
new 
HandleGlowItemFarBlue1 =INVALID_HANDLE;
new 
HandleGlowItemFarRed2 =INVALID_HANDLE;
new 
HandleGlowItemFarGreen2 =INVALID_HANDLE;
new 
HandleGlowItemFarBlue2 =INVALID_HANDLE
This is public OnPluginStart
PHP Code:
    AutoExecConfig(true"mlglow_config");

        
GlowItemFarRed1 CreateConVar("ml_glow_item_far_red_one""0.5"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarGreen1 CreateConVar("ml_glow_item_far_green_one""1.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarBlue1 CreateConVar("ml_glow_item_far_blue_one""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarRed2 CreateConVar("ml_glow_item_far_red_two""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarGreen2 CreateConVar("ml_glow_item_far_green_two""1.0"""FCVAR_PLUGIN|FCVAR_NOTIFY);
        
GlowItemFarBlue2 CreateConVar("ml_glow_item_far_blue_two""0.0"""FCVAR_PLUGIN|FCVAR_NOTIFY); 
This is public Action: Glow1

PHP Code:
case 2//user
            
{
                
ClientCommand(client"cl_glow_item_far_b %d"GlowItemFarBlue1);
                
ClientCommand(client"cl_glow_item_far_g %d"GlowItemFarGreen1);
                
ClientCommand(client"cl_glow_item_far_r %d"GlowItemFarRed1);
            } 
This is public Action: Glow2
PHP Code:
case 2//user
            
{
                
ClientCommand(client"cl_glow_item_far_b %d"GlowItemFarBlue2);
                
ClientCommand(client"cl_glow_item_far_g %d"GlowItemFarGreen2);
                
ClientCommand(client"cl_glow_item_far_r %d"GlowItemFarRed2);
            } 
But I that does not properly do it, because nothing works
You have the convars set using floats, but are trying to put them into the function as integers, use %f instead. The other problem is that you can't read directly from convars.

PHP Code:

ClientCommand
(client"cl_glow_item_far_r %f"GetConvarFloat(GlowItemFarRed2)); 
Though I would suggest hooking it like I did with the first cvar. Look at my example in the code.

I added min & max values because the script doesn't know what to do if its set over 2...

--

I see you changed the glowhook default value to 1, you don't need to do that as glowhook's value is automatically taken from whatever the cvar is set to when configs are executed.
So basically changing it to 1 does nothing xD

Last edited by Dragonshadow; 07-31-2009 at 08:06.
Dragonshadow is offline
Pontifex
Member
Join Date: Feb 2009
Old 07-31-2009 , 08:05   Re: [L4D] Glow (with pulse)
Reply With Quote #29

How do value max 3.000000?

Quote:
I see you changed the glowhook default value to 1, you don't need to do that as glowhook's value is automatically taken from whatever the cvar is set to when configs are executed.
So basically changing it to 1 does nothing xD
In my game ml_glow 0 is when you start at if glowhook = 0

Quote:
You have the convars set using floats, but are trying to put them into the function as integers, use %f instead. The other problem is that you can't read directly from convars.

Though I would suggest hooking it like I did with the first cvar. Look at my example in the code.
Thx, I will try now
__________________
Sorry for my bad English

Last edited by Pontifex; 07-31-2009 at 08:21.
Pontifex is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-31-2009 , 10:59   Re: [L4D] Glow (with pulse)
Reply With Quote #30

Quote:
Originally Posted by Pontifex View Post
How do value max 3.000000?
PHP Code:
MLGlow CreateConVar("ml_glow""1""Glow Mode (0 - default, 1 - Q1 glow, 2 - D1 glow)"FCVAR_PLUGIN|FCVAR_NOTIFYtrue0.0true2.0); 
You see this:

PHP Code:
true0.0true2.0); 
The first true tells it that is does have a minimum value, 0.0 tells it that its min value is 0.0, second true tells it that it does have a max value, and the number following tells it what the max value is.

So to increase the max value to 3, change 2.0 to 3.0
Quote:
Originally Posted by Pontifex View Post
In my game ml_glow 0 is when you start at if glowhook = 0


Thx, I will try now
It shouldn't do that, because of this:

PHP Code:
public OnConfigsExecuted() 
{
    
glowhook GetConVarInt(MLGlow);

glowhook will equal what the convar is set to once all configs are exec'd.
Dragonshadow is offline
Reply



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 21:27.


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