Raised This Month: $32 Target: $400
 8% 

True Armor


Post New Thread Reply   
 
Thread Tools Display Modes
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 06-18-2008 , 12:24   Re: True Armor
Reply With Quote #11

Looks like plugin resets all the armor if damage is greater than armor points a player has:
armor = 99
gamage = 100
ta_perc = 1.0
new_armor = 99 - 100 = -1
damage = armor - new_armor = (99 - (-1))*1.0 = 100 <- this is HP damage!
__________________
my modest stuff: AXN 1.6.1 | plugins | bsp2csdm
Simon Logic is offline
Send a message via Skype™ to Simon Logic
YaMaKaSi92
Member
Join Date: Nov 2007
Location: Poland
Old 06-18-2008 , 16:25   Re: True Armor
Reply With Quote #12

Plugin failed to compile! Please try contacting the author.Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/2/3/0/7/8/26071.attach(3) : fatal error 100: cannot read from file: "hamsandwich"

Compilation aborted.

I dont know download this file .amxx
1 Error.
__________________

YaMaKaSi92 is offline
Send a message via Skype™ to YaMaKaSi92
Stixsmaster
Veteran Member
Join Date: May 2007
Location: I am all around you...I
Old 06-18-2008 , 17:45   Re: True Armor
Reply With Quote #13

I believe this is for amxmodx v1.80 or higher...that or the online compiler does not utilize hamsandwich hence you must compile via LAN...

---Stixsmaster
__________________
Stixsmaster is offline
Send a message via AIM to Stixsmaster Send a message via MSN to Stixsmaster
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 06-18-2008 , 18:04   Re: True Armor
Reply With Quote #14

Simon Logic: Thanks.

YaMaKaSi: You must locally compile.

Updated 1.1a.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
DarkSidero
Junior Member
Join Date: Jul 2009
Location: Romania
Old 07-29-2009 , 04:41   Re: True Armor
Reply With Quote #15

Code:
public passDamage(this, id, attacker, Float:damage, damagebits)
{
    new Float:armor = float(get_user_armor(this))
    if(armor>0)
    {
        new Float:new_armor = armor - (damage / get_pcvar_float(pPerc))
        if(new_armor<0)
        {
            set_user_armor(this, 0)
            
            ExecuteHam(Ham_TakeDamage, this, id, attacker, (-new_armor)*get_pcvar_float(pPerc), damagebits);
        }
        
        else
            set_user_armor(this, floatround(armor-new_armor))
    }
    else
        ExecuteHam(Ham_TakeDamage, this, id, attacker, damage, damagebits);
    
}
Isn't this wrong? Imo, it should be:

Code:
public passDamage(this, id, attacker, Float:damage, damagebits)
{
    new Float:armor = float(get_user_armor(this))
    if(armor>0)
    {
        new Float:new_armor = armor - (damage / get_pcvar_float(pPerc))
        if(new_armor<0)
        {
            set_user_armor(this, 0)
            
            ExecuteHam(Ham_TakeDamage, this, id, attacker, (-new_armor)*get_pcvar_float(pPerc), damagebits);
        }
        
        else
            set_user_armor(this, floatround(new_armor))
    }
    else
        ExecuteHam(Ham_TakeDamage, this, id, attacker, damage, damagebits);
    
}
1st way: the player's armor will be set to the damage that the player should've taken. Example: player takes 23 damage and he's got 100 armor, his armor is set to "23", not to "77" as intended.

2nd way: the player's armor will be set to armor minus the damage that the player should've taken. Example: player takes 23 damage and he's got 100 armor, his armor is set to "77".

Other than that, very cool plugin, inspired me .

Last edited by DarkSidero; 07-29-2009 at 04:42. Reason: highlighted mistakes
DarkSidero is offline
Send a message via Yahoo to DarkSidero
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:09.


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