AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to make the faldamage divided by 2 in this code? (https://forums.alliedmods.net/showthread.php?t=121482)

cs1.7 03-16-2010 04:22

how to make the faldamage divided by 2 in this code?
 
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;



Flipper_SPb 03-16-2010 04:47

Re: how to make the faldamage divided by 2 in this code?
 
SetHamParamFloat(4, flDamage * 0.5)

Flipper_SPb 03-16-2010 04:49

Re: how to make the faldamage divided by 2 in this code?
 
add this after "return HAM_SUPERCEDE;" so you will have 0 damage in protect time and 0.5 damage in other time

cs1.7 03-16-2010 13:54

Re: how to make the faldamage divided by 2 in this code?
 
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.

ConnorMcLeod 03-16-2010 14:13

Re: how to make the faldamage divided by 2 in this code?
 
If you don't show your code, i suggest you to fix it by yourself :P

Flipper_SPb 03-16-2010 15:13

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

Originally Posted by cs1.7 (Post 1119359)
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



cs1.7 03-16-2010 16:56

Re: how to make the faldamage divided by 2 in this code?
 
Thanks for your help Flipper_SPb :) :up:

:P


All times are GMT -4. The time now is 08:38.

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