Raised This Month: $ Target: $400
 0% 

MoneyMod ( PRIVATE! ) Wont reduce falldmg?


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-27-2011 , 15:57   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #11

When you set a param on-the-fly you need to hook forward as pre and you don't need to return something. As post, nothing can be changed, which is logic and makes sense.
__________________
Arkshine is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-28-2011 , 00:26   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #12

Well he obviously changed it to pre hook:

Quote:
Originally Posted by HBxander View Post
E: Changed old RegisterHam to -->

PHP Code:
RegisterHam Ham_TakeDamage"player""FwdPlayerTakeDMG" 
But I don't understand why it doesn't want to work.

#EDIT:
I quickly tested this and works just fine:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <engine>

public plugin_init()
{
    
RegisterHam Ham_TakeDamage"player""FwdPlayerTakeDMG" )
}

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 
Float:percent 90.0
            
new Float:reduction = (damage percent) / 100.0

            SetHamParamFloat 
4damage reduction

            
client_print(0print_chat"[debug] %.1f - %.1f = %.1f"damagereduction, (damage reduction))
        }
    }

So you didn't change that or you didn't test it right... or you just don't understand what it does.
__________________

Last edited by Hunter-Digital; 04-28-2011 at 00:36.
Hunter-Digital is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 04-28-2011 , 10:13   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #13

dont I understand what it does? It removes X Damage from you whne you fall down ( DMG_FALL )
as i said, it shows messages right, it just wont reduce ANY Damage.
__________________
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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-28-2011 , 11:20   Re: MoneyMod ( PRIVATE! ) Wont reduce falldmg?
Reply With Quote #14

Declare the plugin at first place of 2rd party plugins.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 04-28-2011, 12:46
Hunter-Digital
This message has been deleted by Hunter-Digital. Reason: actually nvm :}
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 04:31.


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