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

Mirror hostage damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 05-29-2012 , 19:06   Mirror hostage damage
Reply With Quote #1

Didn't see anything that did this already so sorry if something exists. I am looking for a plugin that mirrors damage done to a hostage. This would be similar to the plugin that mirrors damage done by ff, in that if you shoot a hostage, instead of killing it, it would just do the damage to your hp. Would be nice if it had a cvar that controlled the amount of damage reflected back. So if you wanted to have it reflect back double you could. Any takers? Thanks all!
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 06-12-2012 , 11:04   Re: Mirror hostage damage
Reply With Quote #2

Time for a bump.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 06-12-2012 , 11:42   Re: Mirror hostage damage
Reply With Quote #3

Try this, I tested only on Cz :

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

new g_pcvar
new Floatg_fcvar;

new 
g_max_player;

public 
plugin_init( )
{
    
g_pcvar register_cvar"ht_damage_mult""2.0" );
    
    
register_event"HLTV""Event_NewRound""a""1=0""2=0" );
    
RegisterHamHam_TakeDamage"hostage_entity""CHostage_TakeDamage_Pre"false );

    
g_max_player get_maxplayers( );
    
    
Event_NewRound( );
}

public 
Event_NewRound( )
{
    
g_fcvar get_pcvar_floatg_pcvar );
}

public 
CHostage_TakeDamage_PrehostageinflictorattackerFloatdamagedamagebits )
{
    if( 
<= attacker <= g_max_player )
    {
        
ExecuteHamHam_TakeDamageattackerinflictorattackerdamage g_fcvardamagebits );
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;

Attached Files
File Type: sma Get Plugin or Get Source (hostage_mult.sma - 521 views - 766 Bytes)
__________________

Last edited by micapat; 06-12-2012 at 12:15. Reason: Important modification !!!
micapat is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 06-12-2012 , 13:41   Re: Mirror hostage damage
Reply With Quote #4

Thank you good sir. I will test when I get home this evening.

Edit: Plugin works great. Thanks!!
__________________

Last edited by joshknifer; 06-19-2012 at 17:42. Reason: Test Complete
joshknifer is offline
Send a message via Skype™ to joshknifer
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 17:34.


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