Raised This Month: $ Target: $400
 0% 

How to detect when somebody suicides on acid?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 07-28-2010 , 19:11   How to detect when somebody suicides on acid?
Reply With Quote #1

Topic tittle.

Any idea?
AfteR. is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 07-28-2010 , 19:31   Re: How to detect when somebody suicides on acid?
Reply With Quote #2

You can register the touch between player and func_water that contents acid
Mxnn is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 07-29-2010 , 00:13   Re: How to detect when somebody suicides on acid?
Reply With Quote #3

Quote:
Originally Posted by Mxnn View Post
You can register the touch between player and func_water that contents acid
I dont know how to do that

Can you help me?
AfteR. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-29-2010 , 04:46   Re: How to detect when somebody suicides on acid?
Reply With Quote #4

Hook Ham_Killed and check the m_bitsDamageType offset (76) is DMG_ACID.
__________________
Arkshine is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 07-29-2010 , 23:48   Re: How to detect when somebody suicides on acid?
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Hook Ham_Killed and check the m_bitsDamageType offset (76) is DMG_ACID.
Arkshine, unfortunately I know nothing about offsets, could you tell me how to do it?
AfteR. is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 07-30-2010 , 03:34   Re: How to detect when somebody suicides on acid?
Reply With Quote #6

PHP Code:
if(dmgbits DMG_ACID)
{
      
//Do what you want

RedRobster is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-30-2010 , 08:51   Re: How to detect when somebody suicides on acid?
Reply With Quote #7

Untested.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init() 
{
    
RegisterHamHam_Killed "player" "fw_HamKilled" );
}

public 
fw_HamKillediVictim iKiller ShouldGib )
{
    const 
m_bitsDamageType 76;

    new 
iDmgBits get_pdata_intiVictim m_bitsDamageType );
    
    if ( 
iDmgBits DMG_ACID )
    {
        
//Player died from acid damage
    
}

__________________
Bugsy is offline
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 07-30-2010 , 14:37   Re: How to detect when somebody suicides on acid?
Reply With Quote #8

Bugsy, it didn't work. Thanks anyway, I could solve it with this:

PHP Code:
#include <amxmodx>
#include <hamsandwich>

const DMG_ACID 76

public plugin_init()
{
    
    
RegisterHamHam_TakeDamage"player""HamTakeDamagePre")
}

public 
HamTakeDamagePrevicinfattFloat:dmgdmgbits )
{
    if( 
dmgbits DMG_ACID )
        return 
HAM_SUPERCEDE;
        
    return 
HAM_IGNORED;

AfteR. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-30-2010 , 15:11   Re: How to detect when somebody suicides on acid?
Reply With Quote #9

You should have said from the start you wanted to block damage...
__________________
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-30-2010 , 16:22   Re: How to detect when somebody suicides on acid?
Reply With Quote #10

Exactly, you asked how to detect acid suicide (death), not block damage.

Use this instead
PHP Code:
return ( dmgbits DMG_ACID ) ? HAM_SUPERCEDE HAM_IGNORED
__________________
Bugsy 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 00:15.


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