Raised This Month: $ Target: $400
 0% 

Fake damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-11-2011 , 19:16   Fake damage
Reply With Quote #1

I found a few different methods out there
PHP Code:
ExecuteHamB(Ham_TakeDamageattackerinflictorattackerFloat:damagedamagebits); 
The one above. Does it call Ham_TakeDamage? meaning if i was to use this inside of Ham_TakeDamage callback would it make a loop and kill the person?

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

new dmg_reducerdmg_mirrorbool:gBotsRegistered;


public 
plugin_init( )
{
    
register_plugin"Variable Friendly Fire""1.7""=(GrG)= Doc Holiday" );

    
RegisterHamHam_TakeDamage"player""PlayerHurt");
    
    
dmg_reducer get_cvar_pointer("mp_friendlyfire");
    
dmg_mirror get_cvar_pointer("mp_mirrordamage");

}

public 
client_authorizedid )
{
    if( !
gBotsRegistered && is_user_botid ) )
    {
        
set_task0.1"register_bots"id );
    }
}

public 
register_botsid )
{
    if( !
gBotsRegistered && is_user_connectedid ) )
    {
        
RegisterHamFromEntityHam_TakeDamageid"PlayerHurt");
        
gBotsRegistered true;
    }
}


public 
PlayerHurtvictiminflictorattackerFloat:damagedamagebits )
{

    if(
is_user_connectedattacker // Makes sure valid target
    
&& get_user_team(attacker) == get_user_team(victim)) //Checks if the same team
    
{
        if(
get_pcvar_num(dmg_mirror))
        {
            
SetHamParamFloat(4, (damage 2.86 ) * floatclamp(get_pcvar_float(dmg_reducer), 0.01.0));
            
ExecuteHamB(Ham_TakeDamageattackerinflictorattackerFloat:damagedamagebits);
        }
        else
        {
            
SetHamParamFloat(4, (damage 2.86 ) * floatclamp(get_pcvar_float(dmg_reducer), 0.01.0));
        }
    }

Doc-Holiday is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-11-2011 , 21:24   Re: Fake damage
Reply With Quote #2

Why don't you test it yourself?
__________________
Bugsy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-12-2011 , 01:36   Re: Fake damage
Reply With Quote #3

ExecuteHamB calls all hooks, so yes your callback will be called.
If you check if victim is different from attacker, then your call back will be just call twice when there is a team attack.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-12-2011 , 18:50   Re: Fake damage
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
ExecuteHamB calls all hooks, so yes your callback will be called.
If you check if victim is different from attacker, then your call back will be just call twice when there is a team attack.
To bugs... i did.. but the one shot killed me.. thats why i asked if it loops...

and thanks.... ill have to check why it kills me thanks
Doc-Holiday is offline
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 01:57.


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