Raised This Month: $ Target: $400
 0% 

Glow Health [ v1.2 ]


Post New Thread Reply   
 
Thread Tools Display Modes
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 11:03   Re: Glow Health [ v1.0 ]
Reply With Quote #11

Quote:
Originally Posted by Sun Aloe View Post
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?
Whow the hell to do that ?

now im not check if is user spectator or other things i just use get_user_team( id ) , and is check also spectator, i think to post this ( This is not an option is default checking by get_user_team native )
swapped is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 04-17-2014 , 11:44   Re: Glow Health [ v1.1 ]
Reply With Quote #12

I had a similar plugin called "Hp based glow"...

But that got unapproved.
Anyway, Good Job. lets hope for approval !
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 04-17-2014 , 11:47   Re: Glow Health [ v1.1 ]
Reply With Quote #13

Quote:
Originally Posted by ezio_auditore View Post
I had a similar plugin called "Hp based glow"...

But that got unapproved.
Anyway, Good Job. lets hope for approval !
I know, look at Credits.

Thanks
swapped is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 04-17-2014 , 12:07   Re: Glow Health [ v1.1 ]
Reply With Quote #14

Quote:
Originally Posted by swapped View Post
I know, look at Credits.

Thanks
Oh sorry,
I didnt saw it..
Thanks by the way
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-17-2014 , 12:28   Re: Glow Health [ v1.1 ]
Reply With Quote #15

PHP 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");
    
team_cvar        register_cvar("gh_team","4");
    
admin_cvar        register_cvar("gh_admins","0");
}

RegisterHamEvents()
{
    
RegisterHam(Ham_Spawn"player""hk_spawn"1)
    
RegisterHam(Ham_Killed"player""hk_dead"1)
}


public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEVERSIONAUTHOR)

    
register_event"Health""evHealth""be" );

    
RegisterCvars();
    
RegisterHamEvents();

Just write them as default. It is true that this doesn't affect plugin performance but makes it harder to read. If you saw this in another plugin, this doesn't mean that it is ok to add it to your code...

Last edited by HamletEagle; 04-17-2014 at 12:28.
HamletEagle is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 04-17-2014 , 12:33   Re: Glow Health [ v1.1 ]
Reply With Quote #16

Quote:
Originally Posted by HamletEagle View Post
PHP 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");
    
team_cvar        register_cvar("gh_team","4");
    
admin_cvar        register_cvar("gh_admins","0");
}
 
RegisterHamEvents()
{
    
RegisterHam(Ham_Spawn"player""hk_spawn"1)
    
RegisterHam(Ham_Killed"player""hk_dead"1)
}
 
 
public 
plugin_init()
{
    
register_plugin(PLUGIN_NAMEVERSIONAUTHOR)
 
    
register_event"Health""evHealth""be" );
 
    
RegisterCvars();
    
RegisterHamEvents();

Just write them as default. It is true that this doesn't affect plugin performance but makes it harder to read. If you saw this in another plugin, this doesn't mean that it is ok to add it to your code...
perhaps you can indent them as in my Tarus plugin(See my signature)
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Spawner30
BANNED
Join Date: Dec 2013
Location: I Don't Know Yet
Old 04-17-2014 , 12:45   Re: Glow Health [ v1.1 ]
Reply With Quote #17

GJ ^^'
Spawner30 is offline
Send a message via Skype™ to Spawner30
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 04-17-2014 , 13:28   Re: Glow Health [ v1.0 ]
Reply With Quote #18

Quote:
Originally Posted by swapped View Post
will be aded in 1.1



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 !
So I am the one who doesn't have any experience? Really.. Okay. I'm trying to help you and give you feedback. Don't be an asshole. Thank me instead.

Heres one example..
Code:
set_user_rendering(id,kRenderFxGlowShell,0,0,0
-->
Code:
set_user_rendering(id,kRenderFxNone,0,0,0
Code could be cleaned furthermore, but im just removing a few functions to show you some of it.. My point is that you should go through your code and clean it up from junk and fails before you post it as a new plugin submission

Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fun> #define PLUGIN_NAME "Glow Health" #define VERSION "1.1" #define AUTHOR "swapped" new bot_cvar; new red_health_cvar; new green_health_cvar; new yellow_health_cvar; new team_cvar; new admin_cvar; new health_client[33]; public plugin_init() {     register_plugin(PLUGIN_NAME, VERSION, AUTHOR)     register_event( "Health", "evHealth", "be" );     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");     team_cvar       = register_cvar("gh_team","4");     admin_cvar      = register_cvar("gh_admins","0");         RegisterHam(Ham_Spawn, "player", "hk_spawn", 1)     RegisterHam(Ham_Killed, "player", "hk_dead", 1) } public evHealth( id ) {     health_client[id] = get_user_health( id );     if(is_user_bot( id ) && !get_pcvar_num(bot_cvar))         set_user_rendering(id,kRenderFxNone, 0,0,0,kRenderNormal,25)     if(is_user_admin( id ) && get_pcvar_num(admin_cvar))         set_user_rendering(id,kRenderFxNone, 0,0,0,kRenderNormal,25)     if(!get_user_team( id ) == get_pcvar_num(team_cvar))         set_user_rendering(id,kRenderFxNone, 0,0,0,kRenderNormal,25)     if(health_client[id] < get_pcvar_num(red_health_cvar))     {         set_user_rendering(id,kRenderFxGlowShell, 255, 0, 0,kRenderNormal,25)     }     else if(health_client[id] < get_pcvar_num(yellow_health_cvar) && health_client[id] > get_pcvar_num(red_health_cvar))     {         set_user_rendering(id,kRenderFxGlowShell, 253, 253, 27,kRenderNormal, 25)     }     else if(health_client[id] > get_pcvar_num(yellow_health_cvar) && health_client[id] < get_pcvar_num(green_health_cvar))     {         set_user_rendering(id,kRenderFxGlowShell, 0, 255, 0,kRenderNormal,25)     }     else     {         set_user_rendering(id,kRenderFxGlowShell, 0 , 255 , 0,kRenderNormal,25)     } } public hk_spawn( id ) {     health_client[id] = get_user_health( id );     if( is_user_alive( id ) )     {         set_user_rendering(id,kRenderFxGlowShell, 0, 255, 0,kRenderNormal,25)     } } public client_putinserver(id) {     if( is_user_alive( id ) )     {         colorx( id, 0, 255, 0 );     } }



Also reading these might help some

Pawn Picture Tutorial
Good programming habits
__________________
PM me for private work.



Last edited by Buckshot; 04-17-2014 at 13:46.
Buckshot is offline
Send a message via Skype™ to Buckshot
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 04-17-2014 , 13:35   Re: Glow Health [ v1.1 ]
Reply With Quote #19

It seems that you don't know shit about programing. Why do you even try?
__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 04-17-2014 at 13:35.
GuskiS is offline
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 04-17-2014 , 13:53   Re: Glow Health [ v1.1 ]
Reply With Quote #20

Quote:
Originally Posted by GuskiS View Post
It seems that you don't know shit about programing. Why do you even try?
Doon't go that hard on him.. everyone can learn.. But i agree he shouldnt post these plugins right now, until he learns some more..
__________________
PM me for private work.


Buckshot is offline
Send a message via Skype™ to Buckshot
Old 04-18-2014, 03:12
swapped
This message has been deleted by swapped. Reason: anywhey..
Old 04-18-2014, 03:15
swapped
This message has been deleted by swapped. Reason: nvm
Old 04-18-2014, 03:16
swapped
This message has been deleted by swapped. Reason: nvm
Old 04-18-2014, 05:02
HamletEagle
This message has been deleted by YamiKaitou. Reason: cleanup
Old 04-18-2014, 05:15
swapped
This message has been deleted by swapped. Reason: retard...
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 02:18.


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