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

Zero (0) HP Bug Fix by Exolent


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay        Approver:   Emp` (115)
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-08-2008 , 22:12   Zero (0) HP Bug Fix by Exolent
Reply With Quote #1

Intro:
  • Have you ever had messed up movements and zero (0) health on your HUD?
  • This happens from having more than 255 health, and then falling, which causes you to lose health, which sometimes results in having zero (0) health.
  • Then, when this happens, you ask for an admin (if you aren't one) to slap you or give you some health.
  • Well, this plugin blocks the possibility of having zero (0) health!
How to use:
  • Click Get Plugin at the bottom of this post, and place the file in your server's addons/amxmodx/plugins folder
  • Open the plugins.ini file located in your server's addons/amxmodx/configs folder
  • At the very bottom, type zero_hp_fix.amxx
Changelog:
  • Version 0.1
    - Initial Release
  • Version 0.2
    - Changed math
  • Version 0.3
    - Removed Fakemeta
  • Version 0.4
    - Changed HP Check for 255 or greater
Attached Files
File Type: sma Get Plugin or Get Source (zero_hp_fix.sma - 3598 views - 422 Bytes)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 07-23-2008 at 04:08. Reason: Update
Exolent[jNr] is offline
project
Junior Member
Join Date: Dec 2007
Location: Near X-olent
Old 03-08-2008 , 22:16   Re: Zero (0) HP Bug Fix
Reply With Quote #2

looks hot
__________________
[IMG]http://img171.**************/img171/4240/yaaaaarz3.png[/IMG]
"Nobody knows everything. You will always have a question to ask."
project is offline
Send a message via AIM to project
Bad Coupon
Junior Member
Join Date: Oct 2006
Location: Tempe, Arizona, United S
Old 03-08-2008 , 22:17   Re: Zero (0) HP Bug Fix
Reply With Quote #3

The must have for a surf server. tyvm exo!
__________________

Bad Coupon is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 03-09-2008 , 01:04   Re: Zero (0) HP Bug Fix
Reply With Quote #4

try:

if(hp>0&&hp%256==0){
....
}
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-09-2008 , 01:20   Re: Zero (0) HP Bug Fix
Reply With Quote #5

well if it works fine the way it is, why change it?

also, i never knew what the % sign meant when using it as an operator.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 03-09-2008 , 03:07   Re: Zero (0) HP Bug Fix
Reply With Quote #6

Yay for modulus?
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-09-2008 , 04:00   Re: Zero (0) HP Bug Fix
Reply With Quote #7

for those people who havent upgraded and need to know :\ (not me )
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-09-2008 , 22:08   Re: Zero (0) HP Bug Fix
Reply With Quote #8

Quote:
Originally Posted by X-olent View Post
well if it works fine the way it is, why change it?

also, i never knew what the % sign meant when using it as an operator.
returns the remainder when the two are divided.

kp_uparrow is right though, it would make sense to use that.
Code:
public message_Health(msgid, dest, id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;
	
	static Float:health, hp;
	pev(id, pev_health, health);
	hp = floatround(health);
	
	if( hp > 0 && hp % 256 == 0 )
	{
		set_pev(id, pev_health, ++health);
		set_msg_arg_int(1, get_msg_argtype(1), 1);
	}
	return PLUGIN_CONTINUE;
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-09-2008 , 22:10   Re: Zero (0) HP Bug Fix
Reply With Quote #9

thanks for clearing up how % works

ill update in 1 sec.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-10-2008 , 01:00   Re: Zero (0) HP Bug Fix
Reply With Quote #10

This is not needed: set_pev(id, pev_health, ++health);

you just need to make sure the hud does not show 0 by using:
set_msg_arg_int(1, get_msg_argtype(1), 1);

----------------
You also don't need get_msg_argtype(1) and can just use ARG_BYTE for:
set_msg_arg_int(1, ARG_BYTE, 1);

what i used:
Code:
public message_Health(msgid, dest, id)
{
	if(!is_user_alive(id))
		return PLUGIN_CONTINUE;

	static hp;
	hp = get_msg_arg_int(1);

	if(hp > 0 && (hp % 256) == 0)
	{
		set_msg_arg_int(1, ARG_BYTE, ++hp);
	}
	return PLUGIN_CONTINUE;
}

Last edited by vittu; 03-10-2008 at 01:20.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Reply


Thread Tools
Display Modes

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 19:46.


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