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

Damage Glow v1.4


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-15-2009 , 15:15   Damage Glow v1.4
Reply With Quote #1

Description:

With this plugin you can know who is getting attacked.
The victim will get a glow depending the damage (progressively green to red color)

Cvars:

dg_enable_glow (0|1) Default 1
dg_glow_type (1 - Glow color based on health 2- Glow color based on team ) Default 1

Modules:

Fakemeta
Hamsandwich

Changelog:

v1.4: Added glow modes 1 - Glow color based on health 2- Glow color based on team
v1.3: Added glow color with user health
v1.2: Fix some code tips, thanks Connor ;)
v1.1: Simplified Code
v1.0: First Release

Credits:

arkshine: Code for get progressively green to red color depending the damage.

ConnorMcLeod: tips, tips and more tips

enjoy it!, Simply plugin, just for fun

Servers with this plugin

[Here]
Attached Files
File Type: sma Get Plugin or Get Source (damage_glow.sma - 7796 views - 2.9 KB)
__________________
Find my plugins here..

Ex - Spanish Moderator.

Last edited by Starsailor; 03-24-2009 at 10:27.
Starsailor is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 03-15-2009 , 15:34   Re: Damage Glow v1.0
Reply With Quote #2

Lol

Cool,
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-15-2009 , 15:52   Re: Damage Glow v1.0
Reply With Quote #3

Was pretty sure this plugin was already existing.
1st task is not needed, you glow glow the player when he get damaged.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-15-2009 , 18:27   Re: Damage Glow v1.1
Reply With Quote #4

Updated, thanks Connor

i have searched for this and i can't find anything
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2009 , 02:51   Re: Damage Glow v1.1
Reply With Quote #5

Another suggestion, fm_set_rendering was created to convert easily set_rendering.
I would use a "new" function using directly floats :

PHP Code:
SetRendering(iEntiRenderFx=kRenderFxNoneFloat:flRenderColor[3]={255.0,255.0,255.0}, iRender=kRenderNormalFloat:flAmount=16.0)
{
    
set_pev(iEntpev_renderfxiRenderFx)
    
set_pev(iEntpev_rendercolorflRenderColor)
    
set_pev(iEntpev_rendermodeiRender)
    
set_pev(iEntpev_renderamtflAmount)

PHP Code:
        switch(team)
        {
            case 
1SetRendering(idkRenderFxGlowShellFloat:{200.0,0.0,0.0})
            case 
2SetRendering(idkRenderFxGlowShellFloat:{0.0,0.0,200.0})
        } 
PHP Code:
public remove_glow(id)
{
    
SetRendering(id)


Last, you can do directly : switch(get_user_team(id)), so it would look like :

PHP Code:
        switch(  get_user_teamid )  )
        {
            case 
1SetRendering(idkRenderFxGlowShellFloat:{200.00.00.0})
            case 
2SetRendering(idkRenderFxGlowShellFloat:{0.00.0200.0})
        } 


-edit-
Found the old amx plugin, haven't look the code, may gives you ideas, may not
PHP Code:
/*
*    AMXMOD script.
*    (plugin_glowdamage.sma)
*    by mike_cao <[email protected]>
*    This file is provided as is (no warranties).
*
*    This plugin makes players glow briefly when 
*    damaged. There are team-based glow colors
*    as well as different colors for the amount
*    of damage dealt.
*
*    Use the cvar "amx_glowdamage_mode" in your amx.cfg
*    0 = off
*    1 = default glow damage
*    2 = team-based glow damage
*
*/ 

#include <amxmod>
#include <fun>

#define MAX_NAME_LENGTH 32
#define MAX_PLAYERS 32

// Admin access level
#define ACCESS_LEVEL ADMIN_LEVEL_A

// Color between shots (1=on, 0=off)
#define INTERMEDIATE_GLOW 0

new gGlow
new gGlowState[MAX_PLAYERS+1]

public 
admin_glowdamage(id)
{
    
// Check access level
    
if (!(get_user_flags(id)&ACCESS_LEVEL)) {
        
client_print(idprint_console,"[AMX] You have no access to that command")
        return 
PLUGIN_HANDLED
    
}
    
// Check arguments
    
if (read_argc() < 2) {
        
client_print(idprint_console,"[AMX] Usage: amx_glowdamage < 0 | 1 | 2 > [0=off,1=on,2=team-based]")
        return 
PLUGIN_HANDLED
    
}

    new 
sArg[MAX_NAME_LENGTH+1]
    
read_argv(1,sArg,MAX_NAME_LENGTH)
    
set_cvar_num("amx_glowdamage_mode",str_to_num(sArg))
    
    if ( 
equal(sArg,"0") ) {
        
client_print(id,print_console,"[AMX] Glow damage is now off")
        
msg_display("Glow Damage Disabled.",0,200,0)
    }
    else if ( 
equal(sArg,"1") ) {
        
client_print(id,print_console,"[AMX] Glow damage is now on")
        
msg_display("Glow Damage Enabled.",0,200,0)
    }
    else if ( 
equal(sArg,"2") ) {
        
client_print(id,print_console,"[AMX] Team-based glow damage is now on")
        
msg_display("Team-based Glow Damage Enabled.",0,200,0)
    }

    return 
PLUGIN_HANDLED
}

public 
msg_display(msg[],r,g,b)
{
    
set_hudmessage(r,g,b,0.05,0.65,2,0.02,10.0,0.01,0.1,2)
    
show_hudmessage(0,msg)
}

public 
player_glow_on(player,r,g,b,size)
{
    new 
Params[1]
    
Params[0] = player
    set_user_rendering
(player,kRenderFxGlowShell,r,g,b,kRenderNormal,size)
    
set_task(0.5,"player_glow_off",0,Params,1);
    return 
PLUGIN_CONTINUE
}

public 
player_glow_off(Params[])
{
    
set_user_rendering(Params[0])
    return 
PLUGIN_CONTINUE
}

public 
event_glowdamage()
{    
    new 
iRiGiBiSizeiColoriState
    
new iVictim read_data(0)
    new 
iDamage read_data(2)
    new 
sTeam[MAX_NAME_LENGTH+1]
    
    
gGlow get_cvar_num("amx_glowdamage_mode")

    
get_user_team(iVictim,sTeam,MAX_NAME_LENGTH);
    
iColor INTERMEDIATE_GLOW

    
if (iColor) {
        
iState gGlowState[iVictim]
        if(
iState) {
            
gGlowState[iVictim] = 0
        
} else {
            
gGlowState[iVictim] = 1
        
}
    }
    
    if (
gGlow && !iState) {
        
// Heavy damage
        
if (iDamage 30) {
            
iSize 20
            
// Team-based
            
if (gGlow == 2) {
                
// Team 1
                
if ( equal(sTeam,"TERRORIST") ) {
                    
iR 255
                    iG 
0
                    iB 
0
                
}
                
// Team 2
                
else if ( equal(sTeam,"CT") ) {
                    
iR 0
                    iG 
192
                    iB 
255
                
}
                
// Default
                
else {
                    
iR 255
                    iG 
128
                    iB 
0
                
}
            }
            
// Non team-based
            
else {
                
iR 255
                iG 
128
                iB 
0
            
}
        }
        
// Medium damage
        
else if (iDamage 20) {
            
iSize 10
            
// Team-based
            
if (gGlow == 2) {
                
// Team 1
                
if ( equal(sTeam,"TERRORIST") ) {
                    
iR 128
                    iG 
0
                    iB 
0
                
}
                
// Team 2
                
else if ( equal(sTeam,"CT") ) {
                    
iR 0
                    iG 
128
                    iB 
192
                
}
                
// Default
                
else {
                    
iR 255
                    iG 
96
                    iB 
0
                
}
            }
            
// Non team-based
            
else {
                
iR 255
                iG 
96
                iB 
0
            
}
        }
        
// Low damage
        
else if (iDamage 10) {
            
iSize 0
            
// Team-based
            
if (gGlow == 2) {
                
// Team 1
                
if ( equal(sTeam,"TERRORIST") ) {
                    
iR 64
                    iG 
0
                    iB 
0
                
}
                
// Team 2
                
else if ( equal(sTeam,"CT") ) {
                    
iR 0
                    iG 
64
                    iB 
128
                
}
                
// Default
                
else {
                    
iR 255
                    iG 
64
                    iB 
0
                
}
            }
            
// Non team-based
            
else {
                
iR 255
                iG 
64
                iB 
0
            
}
        }
    }
    
// Intermediate color
    
else if ( gGlow && iState ) {
        
iR 255
        iG 
255
        iB 
255
    
}
    
// Glow player
    
if (gGlow) {
        
player_glow_on(iVictim,iR,iG,iB,iSize)
    }
    return 
PLUGIN_CONTINUE;
}

public 
plugin_init()
{
    
register_plugin("Glow Damage","1.0","mike_cao")
    
register_clcmd("amx_glowdamage","admin_glowdamage",ACCESS_LEVEL,"amx_glowdamage < 0 | 1 | 2 >")
    
register_event("Damage","event_glowdamage","b","2!0","3=0","4!0")
    
register_cvar("amx_glowdamage_mode","1")
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-16-2009 at 03:15.
ConnorMcLeod is offline
Satoko
Senior Member
Join Date: Oct 2008
Location: Germany
Old 03-16-2009 , 11:57   Re: Damage Glow v1.1
Reply With Quote #6

well damage glow would be better to have it this way.

100 - 85% no glow, 85 - 60% green glow, 60 - 33% orange glow 33 - 1% red glow no matter what team he is.
__________________

Satoko is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-16-2009 , 13:00   Re: Damage Glow v1.2
Reply With Quote #7

v1.2 updated, thanks connor again
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2009 , 14:56   Re: Damage Glow v1.2
Reply With Quote #8

new Float:CTRenderColor[3]={0.0,0.0,200.0}

->

new const Float:CTRenderColor[3]={0.0,0.0,200.0}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 03-16-2009 , 15:16   Re: Damage Glow v1.2
Reply With Quote #9

with new const Float

Error: Argument type mismatch (argument 3) on line 50
Error: Argument type mismatch (argument 3) on line 51

__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2009 , 15:22   Re: Damage Glow v1.2
Reply With Quote #10

Yeah i see, you would have to declare the array as const in the stock, so let it like it is now is just fine
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 18:25.


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