Raised This Month: $32 Target: $400
 8% 

HE Grenade dose not take damage to owner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 04-03-2015 , 12:43   HE Grenade dose not take damage to owner
Reply With Quote #1

Title says all
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-03-2015 , 13:53   Re: HE Grenade dose not take damage to owner
Reply With Quote #2

https://forums.alliedmods.net/showpo...83&postcount=4

"ngs_allowdamage 0"
Kz1.0 is offline
Decak
Senior Member
Join Date: Sep 2012
Old 04-03-2015 , 18:08   Re: HE Grenade dose not take damage to owner
Reply With Quote #3

@Kz1.0 It's for all.
@BaD CopY Here it is:

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

public plugin_init() {
	register_plugin("No Owner Grenade DMG", "1.0", "DecaK")
	RegisterHam(Ham_TakeDamage, "player", "takedamage")
}

public takedamage(victim,inflictor,attacker,float:damage,damagebits)
	if((damagebits & (1<<24)) && (get_user_flags(victim) & ADMIN_RCON))
		return HAM_SUPERCEDE;

Last edited by Decak; 04-03-2015 at 18:10.
Decak is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-03-2015 , 23:37   Re: HE Grenade dose not take damage to owner
Reply With Quote #4

He needs to make players take no damage from their own grenades.
Your plugin make players with ADMIN_RCON flag invurnable to any grenades.
Kz1.0 is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 04-04-2015 , 01:21   Re: HE Grenade dose not take damage to owner
Reply With Quote #5

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

public plugin_init()
{
     
RegisterHam(Ham_TakeDamage"player""fw_takedamage")
}
public 
fw_takedamage(victiminflictorattackerFloatdamage)
{
     if(
is_user_connected(victim) && victim == attacker && read_data(2) == CSW_HEGRENADE)
          
SetHamParamFloat(4damage 0.0)

not tested
}
__________________
Shiina.Mashiro is offline
Decak
Senior Member
Join Date: Sep 2012
Old 04-04-2015 , 07:40   Re: HE Grenade dose not take damage to owner
Reply With Quote #6

Hahahah sorry, I think server owner

@Shiina Haha, you don't need that

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

public plugin_init() {
	register_plugin("No Owner Grenade DMG", "1.0", "DecaK")
	RegisterHam(Ham_TakeDamage, "player", "takedamage")
}

public takedamage(victim,inflictor,attacker,float:damage,damagebits)
	if((damagebits & (1<<24)) && (victim == attacker))
		return HAM_SUPERCEDE;
Decak is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 04-04-2015 , 13:49   Re: HE Grenade dose not take damage to owner
Reply With Quote #7

This one works fine for me

PHP Code:
public fw_HamTakeDamageiVictim iInflictor iAttacker FloatfDamage iBitDamage )
{
    if ( ( 
iVictim != iAttacker ) || !iInflictor || !( iBitDamage DMG_GRENADE ) )
    {
        return 
HAM_IGNORED;
    }
    
    new 
FloatfHealth;
    
peviVictim pev_health fHealth );
    
    return ( 
fDamage >= fHealth ) ? HAM_SUPERCEDE HAM_IGNORED;

BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
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 18:51.


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