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

Request for Damage Glow change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakugan
Junior Member
Join Date: Dec 2023
Location: Bulgaria
Old 02-22-2024 , 15:07   Request for Damage Glow change
Reply With Quote #1

Can this code be changed so that the color of nemesis is removed and instead a color of this type is displayed? CT should shine blue, and the Terrorist group should shine red.



Code:
/* 
 Glow Damage v1.10.1
 
* Details : Makes players glow when damage. 

* Cvars: 
glowdamage_type 1/2
1= Random Colors
2= Colors in function by user team : Terro Team and CT Team and if Damage > 15 have some colors,
else if damage > 40 have another colors, etc

* Tests:
- Tested on CS 1.6 with AMXMODX 1.10.1

* Required Modules
- Fun & Cstrike

* Credits:
- Doombringer for an fixed on CS Teams 
- MaximusBrood for if conditions fixes

Have a nice day now
*/

#include <amxmodx>
#include <fun>
#include <cstrike>
 
new const PLUGIN[] = "Glow Damage"
new const VERSION[] = "1.10.1"
new const AUTHOR[] = "Test"
 
new pcvartype;
 
public plugin_init() 
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        pcvartype = register_cvar("glowdamage_type","1")
        register_event("Damage","glow_event","b","2!0","3=0","4!0")
         
}
 

 
public glow_event()
{
        new r,g,b
 
        new Victim = read_data(0)
        new Damage = get_user_health(Victim)
 
        new CsTeams:playert = cs_get_user_team(Victim)
 
        switch (get_pcvar_num(pcvartype))
        {
                case 1:
                {
                        // random num for r,g,b colors
                        r = random_num(0,255)
                        g = random_num(0,255)
                        b = random_num(0,255)
                }
        
                case 2:
                {
                        // if is user from Terro team
                        if(playert == CS_TEAM_T)
                        {
                            if (Damage < 15)
                            {
                                r = 255
                                g = 80
                                b = 0
                            } else if(Damage > 40)
                            {
                                r = 255
                                g = 0
                                b = 0
                            } else
                            {
                                r = 200
                                g = 70
                                b = 0
                            }
                        } else
                        {
                            if(Damage <= 15)
                            {
                                r = 23
                                g = 243
                                b = 0
                            } else if(Damage >= 40)
                            {
                                r = 0
                                g = 255
                                b = 0 
                            } else
                            {
                                r = 0
                                g = 65
                                b = 12
                            }
                        }
                }
        }
        
        playerglow(Victim,r,g,b)
 
        return PLUGIN_HANDLED
} 

public playerglow(player,r,g,b)
{
    new Params[1]
    Params[0] = player    
    set_user_rendering(player,kRenderFxGlowShell,r,g,b,kRenderNormal,25)
    set_task(1.0,"stopglow",0,Params,1);
                      
}

public stopglow(Params[])
{
    if( !is_user_connected(Params[0]) )
        return PLUGIN_HANDLED;
    
    set_user_rendering(Params[0],kRenderFxGlowShell,0,0,0,kRenderNormal,25)
    return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
When someone shoots towards the enemy, I want it to light up entirely in red for (T) and blue for (CT). Here's a slight improvement on the picture; you can see what it's almost about.



Here is the translation:

"This is exactly how I want it to look when players from the teams shoot at each other. In the picture, as you can see, there are arrows drawn on the ground and on the wall.
__________________
WebSite
bakugan is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 03-10-2024 , 08:52   Re: Request for Damage Glow change
Reply With Quote #2

my dear, this has no relation to "Module Coding", move it here.
__________________
mlibre is offline
bakugan
Junior Member
Join Date: Dec 2023
Location: Bulgaria
Old 03-15-2024 , 18:08   Re: Request for Damage Glow change
Reply With Quote #3

Thank you! I posted new Lock topic
__________________
WebSite
bakugan 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 05:30.


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