Raised This Month: $319 Target: $400
 79%   Almost there!

Solved Block lava / toxic damage (CS)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky
Senior Member
Join Date: Jul 2005
Old 09-25-2017 , 16:56   Block lava / toxic damage (CS)
Reply With Quote #1

Looking for a simple script to block damage or death that occurs on certain custom maps, whether it be a pool of lava or a out of bounds area of the map. This damage is not the same as drowning but similar.

Last edited by Ricky; 09-26-2017 at 05:30.
Ricky is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-25-2017 , 21:24   Re: Block lava / toxic damage (CS)
Reply With Quote #2

I think with the "dmg_bits" you can block a specific damage. Example:

Code:
public fw_TakeDamage(const victim, inflictor, const attacker, Float:damage, dmg_bits) {     if (victim != attacker || !is_user_alive(attacker))         return HAM_IGNORED;         // Isn't fall damage?     if (~(dmg_bits & DMG_FALL))         return HAM_IGNORED;         return HAM_SUPERCEDE; }
__________________




CrazY. is offline
Ricky
Senior Member
Join Date: Jul 2005
Old 09-25-2017 , 23:06   Re: Block lava / toxic damage (CS)
Reply With Quote #3

Thanks for the attempt but it didn't work for my needs! The death type is trigger_hurt and I think there should be several topics regarding this matter.
Ricky is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 09-26-2017 , 05:36   Re: Block lava / toxic damage (CS)
Reply With Quote #4

I modified the code above. Also you can play with trigger_hurt's key values and set damage to 0.

Code:
public fw_TakeDamage(const victim, inflictor, const attacker, Float:damage, dmg_bits)
{
    if (!attacker)
         return HAM_IGNORED

    static class[32]
    pev(attacker, pev_classname, class, charsmax(class))
   
    if (equal(class, "trigger_hurt"))
         return HAM_SUPERCEDE

    return HAM_IGNORED;
}
__________________


Last edited by NiHiLaNTh; 09-26-2017 at 05:36.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Ricky
Senior Member
Join Date: Jul 2005
Old 09-29-2017 , 15:19   Re: Block lava / toxic damage (CS)
Reply With Quote #5

Quote:
Originally Posted by NiHiLaNTh View Post
I modified the code above. Also you can play with trigger_hurt's key values and set damage to 0.

Code:
public fw_TakeDamage(const victim, inflictor, const attacker, Float:damage, dmg_bits)
{
    if (!attacker)
         return HAM_IGNORED

    static class[32]
    pev(attacker, pev_classname, class, charsmax(class))
   
    if (equal(class, "trigger_hurt"))
         return HAM_SUPERCEDE

    return HAM_IGNORED;
}
Solved. Thank you!
Ricky 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 02:33.


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