Raised This Month: $51 Target: $400
 12% 

how to set 0 damage to a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
labzov
Junior Member
Join Date: Dec 2016
Old 02-17-2017 , 19:14   how to set 0 damage to a player
Reply With Quote #1

i need plugin while player shooting enyone it will not damaged a target

ps sorry for bad english
labzov is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 05:00   Re: how to set 0 damage to a player
Reply With Quote #2

Why would you want such thing ..
PHP Code:
#include < amxmodx >
#include < hamsandwich >

#define DMG_BULLET ( 1<<1 ) 

public plugin_init( ) {

    
register_plugin"Block DMG""1.0""DoNii" );
    
RegisterHamHam_TakeDamage"player""fw_HamTakeDamage" );
}

public 
fw_HamTakeDamagevictiminflictorattackerFloat:damagedamagebits ) {

    if( 
damagebits DMG_BULLET )
    return 
HAM_SUPERCEDE;
            
    return 
HAM_IGNORED;

__________________

Last edited by edon1337; 02-18-2017 at 09:37.
edon1337 is offline
labzov
Junior Member
Join Date: Dec 2016
Old 02-18-2017 , 09:30   Re: how to set 0 damage to a player
Reply With Quote #3

i want something else! i need to set 0 dmg for target player only
eg. write in console /set_player_damage <player_id>

Last edited by labzov; 02-18-2017 at 10:04.
labzov is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-18-2017 , 09:38   Re: how to set 0 damage to a player
Reply With Quote #4

I think this one is better, because the other code won't affect knife damage
PHP Code:
#include < amxmodx >
#include < hamsandwich >

#define DMG_BULLET ( 1<<1 ) 
#define DMG_NEVERGIB ( 1<<12 )
#define DMG_KNIFE ( DMG_NEVERGIB | DMG_BULLET )

public plugin_init( ) {

    
register_plugin"Block DMG""1.0""DoNii" );
    
RegisterHamHam_TakeDamage"player""fw_HamTakeDamage" );
}

public 
fw_HamTakeDamagevictiminflictorattackerFloat:damagedamagebits ) {

    if( ( 
get_user_weaponattacker ) == CSW_KNIFE && damagebits DMG_KNIFE ) || ( damagebits DMG_BULLET ) )
    return 
HAM_SUPERCEDE;

    return 
HAM_IGNORED;

__________________

Last edited by edon1337; 02-18-2017 at 09:41.
edon1337 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 01:14.


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