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

Glow client?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 06-25-2011 , 17:55   Glow client?
Reply With Quote #1

Obviously I'm doing something wrong, so am wondering if this is not possible or...

I'm trying to get all the players to have a glow around them. Kind of like a forced glow. (l4d2)

PHP Code:
glow()
{
    
// turn on glow
    
for (new 1<= MAXPLAYERSi++)
    {
        
SetEntProp(iProp_Send"m_bSurvivorGlowEnabled"1);
        
SetEntProp(iProp_Send"m_glowColorOverride"255255);
    }
    
CreateTimer(15.0_DisableGlow);
}

public 
Action:_DisableGlow(Handle:timer)
{
    
// turn off glow
    
for (new 1<= MAXPLAYERSi++)
    {
        
SetEntProp(iProp_Send"m_bSurvivorGlowEnabled"0);
        
SetEntProp(iProp_Send"m_glowColorOverride"0);
    }

Thanks for your help!

Last edited by ajr1234; 06-25-2011 at 17:59.
ajr1234 is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 06-25-2011 , 18:25   Re: Glow client?
Reply With Quote #2

I wrote some glow stocks some time ago.

PHP Code:
enum L4D2GlowType
{
    
L4D2Glow_None 0,
    
L4D2Glow_OnUse,
    
L4D2Glow_OnLookAt,
    
L4D2Glow_Constant
}

/**
 * Set entity glow. This is consider safer and more robust over setting each glow
 * property on their own because glow offset will be check first.
 *
 * @param entity        Entity index.
 * @parma type            Glow type.
 * @param range            Glow max range, 0 for unlimited.
 * @param minRange        Glow min range.
 * @param colorOverride Glow color, RGB.
 * @param flashing        Whether the glow will be flashing.
 * @return                True if glow was set, false if entity does not support
 *                        glow.
 */
stock bool:L4D2_SetEntGlow(entityL4D2GlowType:typerangeminRangecolorOverride[3], bool:flashing)
{
    
decl String:netclass[128];
    
GetEntityNetClass(entitynetclass128);

    new 
offset FindSendPropInfo(netclass"m_iGlowType");
    if (
offset 1)
    {
        return 
false;    
    }

    
L4D2_SetEntityGlow_Type(entitytype);
    
L4D2_SetEntityGlow_Range(entityrange);
    
L4D2_SetEntityGlow_MinRange(entityminRange);
    
L4D2_SetEntityGlow_ColorOverride(entitycolorOverride);
    
L4D2_SetEntityGlow_Flashing(entityflashing);
    return 
true;
}

/**
 * Set entity glow type.
 *
 * @param entity        Entity index.
 * @parma type            Glow type.
 * @noreturn
 * @error                Invalid entity index or entity does not support glow.
 */
stock L4D2_SetEntGlow_Type(entityL4D2GlowType:type)
{
    
SetEntProp(entityProp_Send"m_iGlowType"_:type);
}

/**
 * Set entity glow range.
 *
 * @param entity        Entity index.
 * @parma range            Glow range.
 * @noreturn
 * @error                Invalid entity index or entity does not support glow.
 */
stock L4D2_SetEntGlow_Range(entityrange)
{
    
SetEntProp(entityProp_Send"m_nGlowRange"range);
}

/**
 * Set entity glow min range.
 *
 * @param entity        Entity index.
 * @parma minRange        Glow min range.
 * @noreturn
 * @error                Invalid entity index or entity does not support glow.
 */
stock L4D2_SetEntGlow_MinRange(entityminRange)
{
    
SetEntProp(entityProp_Send"m_nGlowRangeMin"minRange);
}

/**
 * Set entity glow color.
 *
 * @param entity        Entity index.
 * @parma colorOverride    Glow color, RGB.
 * @noreturn
 * @error                Invalid entity index or entity does not support glow.
 */
stock L4D2_SetEntGlow_ColorOverride(entitycolorOverride[3])
{
    
SetEntProp(entityProp_Send"m_glowColorOverride"colorOverride[0] + (colorOverride[1] * 256) + (colorOverride[2] * 65536));
}

/**
 * Set entity glow flashing state.
 *
 * @param entity        Entity index.
 * @parma flashing        Whether glow will be flashing.
 * @noreturn
 * @error                Invalid entity index or entity does not support glow.
 */
stock L4D2_SetEntGlow_Flashing(entitybool:flashing)
{
    
SetEntProp(entityProp_Send"m_bFlashing"_:flashing);

PHP Code:
glow()
{
    
// turn on glow
    
for (new client 1client <= MaxClientsclient++)
    {
        if (!
IsClientInGame(client)) continue;
        
L4D2_SetEntGlow(clientL4D2Glow_Constant00, {255255255}, false);
    }
    
CreateTimer(15.0_DisableGlow);
}

public 
Action:_DisableGlow(Handle:timer)
{
    
// turn off glow
    
for (new client 1client <= MaxClientsclient++)
    {
        if (!
IsClientInGame(client)) continue;
        
L4D2_SetEntGlow(clientL4D2Glow_None00, {255255255}, false);
    }


Last edited by Mr. Zero; 06-25-2011 at 18:27.
Mr. Zero is offline
ajr1234
Senior Member
Join Date: Mar 2011
Location: Chicago, IL, U.S.A.
Old 06-25-2011 , 18:45   Re: Glow client?
Reply With Quote #3

This is awesome! Thank you very much If there was a +rep button I would click it.
ajr1234 is offline
000101010001
Member
Join Date: Dec 2011
Old 01-12-2012 , 11:12   Re: Glow client?
Reply With Quote #4

ok what do we do with this ???? makes no sense to me copy this text and put where exactly
im trying to compile a version of you glows plugin but it is looking for stocks whatever that is ,all im doing is getting rid of max glow but it wont work if anyone knows how please help me or do it for me +)
000101010001 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-12-2012 , 13:35   Re: Glow client?
Reply With Quote #5

Quote:
Originally Posted by 000101010001 View Post
ok what do we do with this ???? makes no sense to me copy this text and put where exactly
im trying to compile a version of you glows plugin but it is looking for stocks whatever that is ,all im doing is getting rid of max glow but it wont work if anyone knows how please help me or do it for me +)
If anyone notice it have typos, this why not work.
Code:
    L4D2_SetEntityGlow_Type(entity, type);
    L4D2_SetEntityGlow_Range(entity, range);
    L4D2_SetEntityGlow_MinRange(entity, minRange);
    L4D2_SetEntityGlow_ColorOverride(entity, colorOverride);
    L4D2_SetEntityGlow_Flashing(entity, flashing);
Here try, I added plugin so you type admin command sm_glow it will glow all players for 15sec
Hope it works because I don't have this game.
Attached Files
File Type: zip l4d2_glow_test.zip (5.1 KB, 334 views)
__________________
Do not Private Message @me
Bacardi is offline
DonProof
Junior Member
Join Date: Jun 2021
Old 06-08-2021 , 23:40   Re: Glow client?
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
If anyone notice it have typos, this why not work.
Code:
    L4D2_SetEntityGlow_Type(entity, type);
    L4D2_SetEntityGlow_Range(entity, range);
    L4D2_SetEntityGlow_MinRange(entity, minRange);
    L4D2_SetEntityGlow_ColorOverride(entity, colorOverride);
    L4D2_SetEntityGlow_Flashing(entity, flashing);
Here try, I added plugin so you type admin command sm_glow it will glow all players for 15sec
Hope it works because I don't have this game.
How can I change the time, add more colors and add it to a menu selector to choose the colors more easily please.
DonProof is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 06-09-2021 , 00:01   Re: Glow client?
Reply With Quote #7

Quote:
Originally Posted by DonProof View Post
How can I change the time, add more colors and add it to a menu selector to choose the colors more easily please.
Quote:
CreateTimer(your time _DisableGlow);
For the menu, you can check this article.

Last edited by Darkwob; 06-09-2021 at 00:02.
Darkwob 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 09:03.


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