Raised This Month: $ Target: $400
 0% 

If damaged teammate more then 100 or 50 HP, print a message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-06-2011 , 14:26   Re: If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #1

What is the value of damage when you shoot him in the leg? What is the value of g_LeftKills[killer] when you shoot him in the left (before adding damage)?

Also, the damage variable is a float so you must treat it as such (meaning that g_LeftKills must be declared as float) and you must compare to floats and not integers (100.0 instead of 100).


You could also consider http://www.amxmodx.org/funcwiki.php?go=func&id=896
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-07-2011 , 00:40   Re: If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #2

also use

set ham param float. to set damage to 0 if you dchange the value of damage

you need to return HAM_SUPERCEDE or OVERRIDE.
Doc-Holiday is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 08-07-2011 , 06:09   Re: If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #3

@fysiks - at public client_connect g_LeftKills[id] is being set to 0, besides, there's no place in the code where the leftkills is being set (except 0) besides the "tk" public. And I'll make sure to treat all its values to floats.

@Doc-Holiday, I really dont know that much in Ham, can you please expand more about what were you trying to say? I didn't understand what were you trying to tell me.
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-07-2011 , 06:12   Re: If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #4

Quote:
Originally Posted by Diegorkable View Post
@fysiks - at public client_connect g_LeftKills[id] is being set to 0, besides, there's no place in the code where the leftkills is being set (except 0) besides the "tk" public. And I'll make sure to treat all its values to floats.
You always have some sort of excuse for not debugging . . .
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-07-2011 , 06:15   Re: If damaged teammate more then 100 or 50 HP, print a message
Reply With Quote #5

Use client_damage csx forward, will make your life easier and you will get correct damage value (it is not the case with TakeDamage forward unless you hook it post and you retrieve dmg_take value)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-07-2011 at 06:17.
ConnorMcLeod is offline
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 03:28.


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