AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Glow Health [ v1.2 ] (https://forums.alliedmods.net/showthread.php?t=238767)

swapped 04-16-2014 10:16

Glow Health [ v1.2 ]
 
1 Attachment(s)
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


GinNNy 04-16-2014 10:44

Re: Glow Health [ v1.0 ]
 
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

swapped 04-16-2014 10:46

Re: Glow Health [ v1.0 ]
 
Quote:

Originally Posted by GinNNy (Post 2125326)
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.

Sun Aloe 04-16-2014 13:37

Re: Glow Health [ v1.0 ]
 
I think a cvar to define if you want this to work between everyone or just teammates would be good.

Buckshot 04-16-2014 18:01

Re: Glow Health [ v1.0 ]
 
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.

swapped 04-16-2014 23:55

Re: Glow Health [ v1.0 ]
 
Quote:

Originally Posted by Sun Aloe (Post 2125415)
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 (Post 2125548)
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 !

swapped 04-17-2014 00:10

Re: Glow Health [ v1.1 ]
 
Update, check source & changelog

Kia 04-17-2014 05:17

Re: Glow Health [ v1.0 ]
 
Quote:

Originally Posted by swapped (Post 2125636)
so dont comment if you dont have experience.

:crab:

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.

swapped 04-17-2014 05:23

Re: Glow Health [ v1.0 ]
 
Quote:

Originally Posted by Kia (Post 2125722)
:crab:

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

Sun Aloe 04-17-2014 10:53

Re: Glow Health [ v1.0 ]
 
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?


All times are GMT -4. The time now is 02:59.

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