Raised This Month: $ Target: $400
 0% 

how to make the faldamage divided by 2 in this code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cs1.7
Senior Member
Join Date: Oct 2008
Old 03-16-2010 , 04:22   how to make the faldamage divided by 2 in this code?
Reply With Quote #1

if player suffers from falldamage, i want his falldamage to be divided by 2 (falldamage/2)

PHP Code:
public FwdHamPlayerDamageididInflictoridAttackerFloat:flDamageiDamageBits ) {
    if( 
iDamageBits DMG_FALL )
        if( 
get_gametime() < g_fProtectTime[id])
        return 
HAM_SUPERCEDE;
    return 
HAM_IGNORED;

__________________
_____________
/_____\
[° ||| °]
./..............\▓
cs1.7 is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-16-2010 , 04:47   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #2

SetHamParamFloat(4, flDamage * 0.5)
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-16-2010 , 04:49   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #3

add this after "return HAM_SUPERCEDE;" so you will have 0 damage in protect time and 0.5 damage in other time

Last edited by Flipper_SPb; 03-16-2010 at 04:52.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
cs1.7
Senior Member
Join Date: Oct 2008
Old 03-16-2010 , 13:54   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #4

I did that and installed the plugin.

After playing, i have a strong feeling that ALL damages are manipulated by 0.5.
Not only the falldamage!
Is takes all your mgazine to kill one person!

Can anyone comment?

__________________________________

edit:

i did another test. This time with a value of 0.001.

I am very sure now it is the case that ALL damages are affeted by this value.

There has to be a check again, to make sure the damage is falldamage only.
__________________
_____________
/_____\
[° ||| °]
./..............\▓

Last edited by cs1.7; 03-16-2010 at 14:08.
cs1.7 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2010 , 14:13   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #5

If you don't show your code, i suggest you to fix it by yourself
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 03-16-2010 , 15:13   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #6

Quote:
Originally Posted by cs1.7 View Post
I did that and installed the plugin.

After playing, i have a strong feeling that ALL damages are manipulated by 0.5.

Yes. Sorry, It's my mistake.

PHP Code:
public FwdHamPlayerDamageididInflictoridAttackerFloat:flDamageiDamageBits )
{
    if( 
iDamageBits DMG_FALL )
    {
        if( 
get_gametime() < g_fProtectTime[id])
            return 
HAM_SUPERCEDE
        SetHamParamFloat
(4flDamage 0.5
    }
    return 
HAM_HANDLED

Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
cs1.7
Senior Member
Join Date: Oct 2008
Old 03-16-2010 , 16:56   Re: how to make the faldamage divided by 2 in this code?
Reply With Quote #7

Thanks for your help Flipper_SPb

__________________
_____________
/_____\
[° ||| °]
./..............\▓

Last edited by cs1.7; 03-16-2010 at 17:15.
cs1.7 is offline
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 08:38.


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