Raised This Month: $ Target: $400
 0% 

Glow Health [ v1.2 ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 04-17-2014 , 13:28   Re: Glow Health [ v1.0 ]
Reply With Quote #12

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
 



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 17:54.


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