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

Health Kill - v1.2 [9/19/09]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose       
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 09-19-2009 , 20:31   Health Kill - v1.2 [9/19/09]
Reply With Quote #1

Health Kill v1.2


description
With each kill a player makes he is awarded a controllable amount of HP.

cvars
amx_hk_health <#> - Amount of HP received for one kill.
Default: 5

amx_hk_headshot <#> - Amount of HP received for a head-shot.
Default: 10

amx_hk_max <#> - Control the maximum health allowed.
Default: 100

amx_hk_sound <#> - Whether or not to play the sound when a kill is made.
Default: 1

amx_hk_hud <#> - Whether or not to display the hud message for a kill.
Default: 1

changelog

  • Version 1.0
    • Initial Release
  • Version 1.1
    • Added cvar for hud message display
    • Changed return PLUGIN_HANDLED; with return PLUGIN_CONTINUE;
    • Changed SyncHudMsg() to show_hudmessage()
  • Version 1.2
    • Changed death event parameters
    • Changed all HANDLEDs to CONTINUEs
    • Added cvar for maximum health
    • Added cvar for head-shot mode
    • Added a is_user_alive() check
    • Added a get_user_team() check
    • Added a max clients check
    • Fully optimized code

credits
  • My Shower - Thought of the idea while in it.
Attached Files
File Type: sma Get Plugin or Get Source (health_kill.sma - 1770 views - 1.6 KB)

Last edited by BOYSplayCS; 09-19-2009 at 20:32. Reason: Added category
BOYSplayCS is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 09-20-2009 , 03:08   Re: Health Kill - v1.2 [9/19/09]
Reply With Quote #2

Nice
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Xevious
Senior Member
Join Date: Sep 2009
Location: Computer Chair
Old 09-20-2009 , 04:02   Re: Health Kill - v1.2 [9/19/09]
Reply With Quote #3

nice plugin , keep it up.
__________________
Nothing possible when you are not hardworking
Xevious is offline
Send a message via MSN to Xevious
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-20-2009 , 04:09   Re: Health Kill - v1.2 [9/19/09]
Reply With Quote #4

This kind of plugins has already been written many times, why do you wrote it ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-20-2009 , 04:46   Re: Health Kill - v1.2 [9/19/09]
Reply With Quote #5

- iMax is used one time. No need to create a var, use directly get_pcvar_num(cMax).
- iHeadshot is used one time and either you use directly read_data(3), either you create the var after the first check.
- This code is done before the check if iKiller is a player or not. It doesn't make sense. Move these both lines in the check.
Code:
iHealth = get_user_health(iKiller);
iHealth += iAddHp;
Lines you could do directly : iHealth = get_user_health(iKiller) + iAddHp;
- There set_user_health(iKiller, get_user_health(iKiller) + iHealth); ; since you have calculated the value before, it should be only iHealth.
- Btw, why iAddHp, iHealth are global vars ?! It should not.
- There :
Code:
if (!get_pcvar_num(cHud))
	return PLUGIN_CONTINUE;
			
if (!get_pcvar_num(cSound))
	return PLUGIN_CONTINUE;
Do the checks on one line, compiler is idiot and will not optimize like that.
__________________

Last edited by Arkshine; 09-20-2009 at 04:52.
Arkshine is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-20-2009 , 11:17   Re: Health Kill - v1.2 [9/19/09]
Reply With Quote #6

Reposting a plugin because you don't like the decision of an approver is not allowed in any case unless you are specifically instructed to do so.

As a side note, I'm amazed that you're still making mistakes, yet claiming that you can maintain your plugins.

Trashed.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 10:55.


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