Raised This Month: $ Target: $400
 0% 

True armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 05-15-2011 , 05:00   True armor
Reply With Quote #1

Not sure why but for some reason this works like this. It deducts the right about of armor. but armor hits 0 it dosent start to damage the health.

PHP Code:
public PlayerHurt(vicinfattFloat:dmgdamagebits)
{
    if(
vic == g_iVIPid)
    {
        new 
CsArmorType:iPlayerArmorType;
        new 
Float:armor float(cs_get_user_armor(viciPlayerArmorType));
        new 
Float:new_armor armor dmg;
        
        if(
new_armor <= 0)
        {
            
cs_set_user_armor(vic0CS_ARMOR_NONE);
            
SetHamParamFloat(4dmg armor);
            return 
HAM_SUPERCEDE;
        }
        else
        {
            
cs_set_user_armor(vicfloatround(new_armorfloatround_round), CS_ARMOR_VESTHELM);
            
SetHamParamFloat(40.0);
            return 
HAM_SUPERCEDE;
        }
        
        return 
HAM_IGNORED;
    }


Last edited by Doc-Holiday; 05-15-2011 at 05:26.
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2011 , 05:15   Re: True armor
Reply With Quote #2

PHP Code:
public PlayerHurt(vicinfattFloat:dmgdamagebits)
{
    if(
vic == g_iVIPid)
    {
        new 
CsArmorType:iPlayerArmorType;
        new 
Float:armor float(get_user_armor(viciPlayerArmorType));
        if(
armor 0)
        {
            new 
Float:new_armor armor dmg;
            
            if(
new_armor 0)
            {
                
cs_set_user_armor(vic0CS_ARMOR_NONE);
                
SetHamParamFloat(4dmg armor);
            }
            else
            {
                
cs_set_user_armor(vicfloatround(new_armorfloatround_round), CS_ARMOR_VESTHELM);
                
SetHamParamFloat(40.0);
            }
            
            return 
HAM_HANDLED;
        }
    }
    return 
HAM_IGNORED;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 05-15-2011 , 05:26   Re: True armor
Reply With Quote #3

Thanks will try it out. But i left out the cs on cs_get_user_armor on the Float:armor variable.



EDIT: Worked like a charm LOVE YA!!!!

Last edited by Doc-Holiday; 05-15-2011 at 05:30.
Doc-Holiday 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 04:20.


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