Raised This Month: $ Target: $400
 0% 

Tag mismatch (Falldmg reducer)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-21-2010 , 00:18   Re: Tag mismatch (Falldmg reducer)
Reply With Quote #1

Also, you're creating unneeded variables... this is much easier:

PHP Code:
#define DAMAGE_REDUCTION 0.9 /* 90% of total damage is applied, meaning 10% reduction */

new g_iMaxPlayers

// in plugin_init()
    
g_iMaxPlayers get_maxplayers()

//...

public fwTakeDamage(iVictimiInflictoriAttackerFloat:flDamageiDamage_type
{
    if(
iDamage_type DMG_FALL && <= iVictim <= g_iMaxPlayers)
    {
        switch(
dmglevel[iVictim])
        {
            case 
1SetHamParamFloat(4flDamage DAMAGE_REDUCTION); // set the damage
            
case 2/* If you have other cases use switch... if not, just add the dmglevel[iVictim] to the if() above, at the end */
       
}

Or if you want to actually specify the reduction amount, just make the calculations in a single line, don't create variables for each one.
__________________
Hunter-Digital 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 07:03.


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