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

Glow Health [ v1.2 ]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-16-2014 , 10:16   Glow Health [ v1.2 ]
Reply With Quote #1

GLOW HEALTH
[ v1.2, last updated: 18 apr 2014 ]

[IMG]http://img196.**************/img196/4317/about1q.jpg[/IMG]Description:

Based on this idea i made a new plugin.

This plugin is give a specific glow on a specific health.

If you have 100 health ( or more than 70 ) your glow will be green [this mean you are healthy]
If you have 70 health ( or more than 28 ) you will have Yellow [this mean you are sick]
Else you will have red [this mean you are at the point of death]


NOTE : This is only for cs 1.6 furien/surf/classic mod ! ( Also i recomand to let the default cvar value )


[IMG]http://img20.**************/img20/2184/settings3.png[/IMG]Cvars:
  • gh_bot_show
    • 1 - Bots have glow
      0 - Bots dont have
      Default : 1

    gh_admins
    • 0 - Admins have glow
      1 - Admins dont have
      Default : 0

    gh_team
    • 1 - Only terorist have glow
      2 - Only CT`s have glow
      3 - Only Spectators have glow
      4 - All teams have glow
      Default : 4

    gh_red << 25 >>

    gh_green << 100 >>

    gh_yellow << 75 >>

[IMG]http://img38.**************/img38/4548/changelog1.png[/IMG]Credits:
[IMG]http://img30.**************/img30/5649/lang2.jpg[/IMG]Media:
[IMG]http://img20.**************/img20/2184/settings3.png[/IMG]ChangeLog:
Quote:
v1.2
  • Code rewrited ( +indention )
  • Repair an error ( tag mismach ) ( thanks to Spawner30 )

v1.1
  • Code rewrited ( used a global variabile for check player health )
  • Added cvar gh_team
  • Added cvar gh_admins
v1.0
  • First launch
Attached Files
File Type: sma Get Plugin or Get Source (GlowHealth.sma - 930 views - 2.7 KB)

Last edited by swapped; 04-18-2014 at 08:19. Reason: topic stile
swapped is offline
GinNNy
Senior Member
Join Date: Mar 2014
Old 04-16-2014 , 10:44   Re: Glow Health [ v1.0 ]
Reply With Quote #2

plugin name shouldn't contain SPACE. Do it like Glow_Health or GlowHealth or Glow-Health

[ 23] unknown unknown unknown Glow bad load
( 23) Load fails: Plugin file open error (plugin "Glow")
23 plugins, 22 running

Last edited by GinNNy; 04-16-2014 at 10:45.
GinNNy is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-16-2014 , 10:46   Re: Glow Health [ v1.0 ]
Reply With Quote #3

Quote:
Originally Posted by GinNNy View Post
plugin name shouldn't contain SPACE. Do it like Glow_Health or GlowHealth or Glow-Health

[ 23] unknown unknown unknown Glow bad load
( 23) Load fails: Plugin file open error (plugin "Glow")
23 plugins, 22 running
Fixed.
swapped is offline
Sun Aloe
Member
Join Date: Jul 2013
Location: Porto, Portugal
Old 04-16-2014 , 13:37   Re: Glow Health [ v1.0 ]
Reply With Quote #4

I think a cvar to define if you want this to work between everyone or just teammates would be good.

Last edited by Sun Aloe; 04-16-2014 at 13:37.
Sun Aloe is offline
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 04-16-2014 , 18:01   Re: Glow Health [ v1.0 ]
Reply With Quote #5

Why does every title have a wrench photo? It does not make sence.. It would fit at cvars, but it doesn't make sence in the other places..

Also i wanna ask some questions about ur code.. here are some examples.....
Code:
stock colorx(id, color1,color2,color3) {     set_user_rendering(id,kRenderFxGlowShell,color1,color2,color3,kRenderNormal,25) }
Code:
RemoveGlow( id ) {     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25) }

Code:
RegisterCvars() {     bot_cvar       = register_cvar("gh_bot_show","1")     red_health_cvar     = register_cvar("gh_red","25")     green_health_cvar   = register_cvar("gh_green","100")     yellow_health_cvar  = register_cvar("gh_yellow","70") } RegisterHamEvents() {     RegisterHam(Ham_Spawn, "player", "hk_spawn", 1)     RegisterHam(Ham_Killed, "player", "hk_dead", 1) } public plugin_init() { RegisterCvars() RegisterHamEvents() }

That question is WHY?

WHY do you create separate functions and stocks instead of writing ONE single line of code.. ? Most of the functions, and all of the stocks in your code are completely useless...


Also.. This is not needed:
Code:
public client_disconnect( id ) {     RemoveGlow( id );    }
and this is not needed either. In client_putinserver:
Code:
         else     {         RemoveGlow( id );     }
So.. conclusion.. my opinions: useless and horribly badly coded.. sorry if it chocked you..but it's the sad truth. Please read some basic tutorials before releasing plugins.
__________________
PM me for private work.



Last edited by Buckshot; 04-16-2014 at 18:22.
Buckshot is offline
Send a message via Skype™ to Buckshot
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-16-2014 , 23:55   Re: Glow Health [ v1.0 ]
Reply With Quote #6

Quote:
Originally Posted by Sun Aloe View Post
I think a cvar to define if you want this to work between everyone or just teammates would be good.
will be aded in 1.1

Quote:
Originally Posted by Buckshot View Post
Why does every title have a wrench photo? It does not make sence.. It would fit at cvars, but it doesn't make sence in the other places..

Also i wanna ask some questions about ur code.. here are some examples.....
Code:
stock colorx(id, color1,color2,color3) {     set_user_rendering(id,kRenderFxGlowShell,color1,color2,color3,kRenderNormal,25) }
Code:
RemoveGlow( id ) {     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25) }

Code:
RegisterCvars() {     bot_cvar       = register_cvar("gh_bot_show","1")     red_health_cvar     = register_cvar("gh_red","25")     green_health_cvar   = register_cvar("gh_green","100")     yellow_health_cvar  = register_cvar("gh_yellow","70") } RegisterHamEvents() {     RegisterHam(Ham_Spawn, "player", "hk_spawn", 1)     RegisterHam(Ham_Killed, "player", "hk_dead", 1) } public plugin_init() { RegisterCvars() RegisterHamEvents() }

That question is WHY?

WHY do you create separate functions and stocks instead of writing ONE single line of code.. ? Most of the functions, and all of the stocks in your code are completely useless...


Also.. This is not needed:
Code:
public client_disconnect( id ) {     RemoveGlow( id );    }
and this is not needed either. In client_putinserver:
Code:
         else     {         RemoveGlow( id );     }
I see a code exact like my code writed not in the same line in a Exolent plugin so dont comment if you dont have experience.
About my "bad code" if this is true , please tell me where to update my source.
thanks for some optimization , updated to v1.1 !

Last edited by swapped; 04-17-2014 at 00:12.
swapped is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 00:10   Re: Glow Health [ v1.1 ]
Reply With Quote #7

Update, check source & changelog
swapped is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-17-2014 , 05:17   Re: Glow Health [ v1.0 ]
Reply With Quote #8

Quote:
Originally Posted by swapped View Post
so dont comment if you dont have experience.


PHP Code:
if(is_user_botid ) && !get_pcvar_num(bot_cvar))
        
RemoveGlowid );

    if(
is_user_adminid ) && get_pcvar_num(admin_cvar))
        
RemoveGlowid );

    if(!
get_user_teamid ) == get_pcvar_num(team_cvar))
        
RemoveGlowid ); 
Can be merged to one line.

PHP Code:
if(health_client[id] < get_pcvar_num(red_health_cvar))
    {
        
colorx(id25500);

    }

    else if(
health_client[id] < get_pcvar_num(yellow_health_cvar) && health_client[id] > get_pcvar_num(red_health_cvar))
    {
        
colorx(id253,25327);
    }

    else if(
health_client[id] > get_pcvar_num(yellow_health_cvar) && health_client[id] < get_pcvar_num(green_health_cvar))
    {
        
colorx(id0,255,0);
    }

    else
    {
        
colorx(id0,255,0);
    } 
Use case-switch instead of many else if.

Plugin is not very useful, and coding style...meh.
__________________
Kia is offline
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 05:23   Re: Glow Health [ v1.0 ]
Reply With Quote #9

Quote:
Originally Posted by Kia View Post


PHP Code:
if(is_user_botid ) && !get_pcvar_num(bot_cvar))
        
RemoveGlowid );

    if(
is_user_adminid ) && get_pcvar_num(admin_cvar))
        
RemoveGlowid );

    if(!
get_user_teamid ) == get_pcvar_num(team_cvar))
        
RemoveGlowid ); 
Can be merged to one line.

PHP Code:
if(health_client[id] < get_pcvar_num(red_health_cvar))
    {
        
colorx(id25500);

    }

    else if(
health_client[id] < get_pcvar_num(yellow_health_cvar) && health_client[id] > get_pcvar_num(red_health_cvar))
    {
        
colorx(id253,25327);
    }

    else if(
health_client[id] > get_pcvar_num(yellow_health_cvar) && health_client[id] < get_pcvar_num(green_health_cvar))
    {
        
colorx(id0,255,0);
    }

    else
    {
        
colorx(id0,255,0);
    } 
Use case-switch instead of many else if.

Plugin is not very useful, and coding style...meh.
Will be implemented to 1.2

Last edited by swapped; 04-17-2014 at 05:24.
swapped is offline
Sun Aloe
Member
Join Date: Jul 2013
Location: Porto, Portugal
Old 04-17-2014 , 10:53   Re: Glow Health [ v1.0 ]
Reply With Quote #10

Quote:
will be aded in 1.1

gh_team
1 - Only terorist have glow
2 - Only CT`s have glow
3 - Only Spectators have glow
4 - All teams have glow
Default : 4
You didn't get what I meant. I meant a cvar to define if you can only see teammates glowing or everyone.

And... how can a spectator have glow if it's not supposed to be playing?
Sun Aloe 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:31.


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