Raised This Month: $ Target: $400
 0% 

Anti Bomb Self


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fitries
Junior Member
Join Date: Jan 2014
Old 01-24-2014 , 03:18   Anti Bomb Self
Reply With Quote #1

Hello, I Just Killed MySelf With Bomb (HE)
how to remove damage for myself ?
Fitries is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-24-2014 , 03:43   Re: Anti Bomb Self
Reply With Quote #2

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

const DMG_HEGRENADE = (1<<24)

public 
plugin_init()
{
    
register_plugin("No HE SelfDamage""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_TakeDamage"player""OnTakeDamage")
}

public 
OnTakeDamage(victiminflictorattackerFloat:damagedamagetype)
{
    if((
damagetype DMG_HEGRENADE) && is_user_connected(attacker) && attacker == victim)
    {
        
SetHamParamFloat(40.0)
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;


Last edited by yokomo; 01-24-2014 at 03:45.
yokomo is offline
Leonidddd
Member
Join Date: Apr 2012
Old 01-24-2014 , 04:42   Re: Anti Bomb Self
Reply With Quote #3

Where is the check
PHP Code:
is_user_connected(victim
?
and why SetHamParamFloat(4, 0.0) if we are block damage by
PHP Code:
return HAM_SUPERCEDE
?
Leonidddd is offline
Fitries
Junior Member
Join Date: Jan 2014
Old 01-24-2014 , 05:16   Re: Anti Bomb Self
Reply With Quote #4

thanks yokomo, btw, how to change HE damage ?
Fitries is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-24-2014 , 05:16   Re: Anti Bomb Self
Reply With Quote #5

Try to yoko one or try my plugin https://forums.alliedmods.net/showthread.php?t=216946

With mine you can change self damage.
__________________

Last edited by Blizzard_87; 01-24-2014 at 05:17.
Blizzard_87 is offline
Fitries
Junior Member
Join Date: Jan 2014
Old 01-24-2014 , 05:19   Re: Anti Bomb Self
Reply With Quote #6

okay, i'll try

not working

Last edited by Fitries; 01-24-2014 at 05:25.
Fitries is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-24-2014 , 05:25   Re: Anti Bomb Self
Reply With Quote #7

Quote:
Originally Posted by Fitries View Post
not working
whats not working? TV ?
__________________
Blizzard_87 is offline
Fitries
Junior Member
Join Date: Jan 2014
Old 01-24-2014 , 05:31   Re: Anti Bomb Self
Reply With Quote #8

how to kill 2000 health zombie with 4 HE only ?
Fitries is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-24-2014 , 06:19   Re: Anti Bomb Self
Reply With Quote #9

Quote:
Originally Posted by Fitries View Post
how to kill 2000 health zombie with 4 HE only ?
that is a whole new request.. you can only ask one question per thread since you already have the answer to your titled request you need to make another thread.
__________________
Blizzard_87 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-24-2014 , 07:29   Re: Anti Bomb Self
Reply With Quote #10

Quote:
Originally Posted by Fitries View Post
how to kill 2000 health zombie with 4 HE only ?
This should work, to change damage multiplier use cvar "he_damage_multi".

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

const DMG_HEGRENADE = (1<<24)
new 
CvrNadeDamage

public plugin_init()
{
    
register_plugin("No HE SelfDamage""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_TakeDamage"player""OnTakeDamage")
    
    
CvrNadeDamage register_cvar("he_damage_multi""8.0")
}

public 
OnTakeDamage(victiminflictorattackerFloat:damagedamagetype)
{
    if(!
is_user_connected(attacker)) return HAM_IGNORED;
    if(
attacker == victim) return HAM_SUPERCEDE;
    
    if(
damagetype DMG_HEGRENADE)
    {
        
damage *= get_pcvar_float(CvrNadeDamage)
        
SetHamParamFloat(4damage)
        return 
HAM_IGNORED;
    }
    
    return 
HAM_IGNORED;

If you are using CZBot then you need to RegisterHamFromEntity.
yokomo 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 10:13.


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