Raised This Month: $ Target: $400
 0% 

MoneyMod ( PRIVATE! ) Wont reduce falldmg?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 04-27-2011 , 14:06   MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #1

My code:
PHP Code:
public FwdPlayerTakeDMG(iPlayerinflictorattackerFloat:damagedamagebits)
{
    
//If player is alive and the damage is done by falling
    
if(is_user_alive(iPlayer) && (damagebits DMG_FALL) )
    {
        
//If player is either ct or T
        
new CsTeams:team cs_get_user_team(iPlayer);
        if( 
team == CS_TEAM_CT || team == CS_TEAM_T 
        {    
            new 
percent ItemMaxValue FALLDMG ] * iLevel_Item iPlayer ] [ FALLDMG ] / ItemMaxLevel FALLDMG ]
            new 
Float:reduction float floatround ( ( damage float percent ) / 100.0 ), floatround_floor ) )
            
            
SetHamParamFloat 4damage reduction 
            
            
set_hudmessage(0127255, -1.0, -1.0)
            
show_hudmessage iPlayer"Fall Damage Reducer - Level %i^nInitial Damage: %.1f^nTaken Damage: %.1f^nDamage Reduced: %.1f"iLevel_Item iPlayer ] [ FALLDMG ], damagedamage reductionreduction )
        }
    }

- Its showing the Hudmessage with all correct stats, but it doesnt remove any damage s:
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-27-2011 , 14:44   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #2

http://wiki.alliedmods.net/HamSandwi...cking_the_Hook

you must add
Code:
return HAM_HANDLED

Last edited by Nyuszy; 04-27-2011 at 14:47.
Nyuszy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-27-2011 , 14:52   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #3

Quote:
Originally Posted by Nyuszy View Post
http://wiki.alliedmods.net/HamSandwi...cking_the_Hook

you must add
Code:
return HAM_HANDLED
No you don't really have to.


Show the line where you register the forward.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 04-27-2011 , 14:54   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #4

PHP Code:
RegisterHam Ham_TakeDamage"player""FwdPlayerTakeDMG"
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-27-2011 , 15:05   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #5

HBxander
If you registered function as post, use HAM_OVERRIDE.
__________________

SonicSonedit is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2011 , 15:07   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #6

Quote:
Originally Posted by SonicSonedit View Post
HBxander
If you registered functions as post, use HAM_OVERRIDE.
No, that's not his problem.

Quote:
Originally Posted by HBxander View Post
PHP Code:
RegisterHam Ham_TakeDamage"player""FwdPlayerTakeDMG"
Easiest fix is to change that to a pre hook.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 04-27-2011 , 15:07   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #7

E: Changed old RegisterHam to -->

PHP Code:
RegisterHam Ham_TakeDamage"player""FwdPlayerTakeDMG" 
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 04-27-2011 , 15:16   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #8

But.. exolent, the problem aint that it doesnt work, it shows the hudmessage, but it just doesnt remove the damage? s:

cant understand why..
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!
HBxander is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-27-2011 , 15:22   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #9

Stupid question: Is "damage reduced:" showing a number above 0 ?

If it is, I dunno... try some returns, like HAM_HANDLED or HAM_OVERRIDE at least to be sure they're not required.
__________________
Hunter-Digital is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-27-2011 , 15:25   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #10

Exolent[jNr]
Doesn't HAM_OVERRIDE overrides also params when used in post?

Hunter-Digital
That's not the case. The problem is that he uses a post-function, which are not supposed to change params, since they are already passed.
__________________

SonicSonedit 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 04:31.


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