AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Anti Bomb Self (https://forums.alliedmods.net/showthread.php?t=234025)

Fitries 01-24-2014 03:18

Anti Bomb Self
 
Hello, I Just Killed MySelf With Bomb (HE)
how to remove damage for myself ?

yokomo 01-24-2014 03:43

Re: Anti Bomb Self
 
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;



Leonidddd 01-24-2014 04:42

Re: Anti Bomb Self
 
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

?

Fitries 01-24-2014 05:16

Re: Anti Bomb Self
 
thanks yokomo, btw, how to change HE damage ?

Blizzard_87 01-24-2014 05:16

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

With mine you can change self damage.

Fitries 01-24-2014 05:19

Re: Anti Bomb Self
 
okay, i'll try :D

not working :(

Blizzard_87 01-24-2014 05:25

Re: Anti Bomb Self
 
Quote:

Originally Posted by Fitries (Post 2090260)
not working :(

whats not working? TV ?

Fitries 01-24-2014 05:31

Re: Anti Bomb Self
 
how to kill 2000 health zombie with 4 HE only ?

Blizzard_87 01-24-2014 06:19

Re: Anti Bomb Self
 
Quote:

Originally Posted by Fitries (Post 2090265)
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.

yokomo 01-24-2014 07:29

Re: Anti Bomb Self
 
Quote:

Originally Posted by Fitries (Post 2090265)
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.


All times are GMT -4. The time now is 10:13.

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