Raised This Month: $ Target: $400
 0% 

How to get rid of damage type?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Predailien12
Senior Member
Join Date: Feb 2010
Location: Your as* hol*
Old 08-27-2011 , 06:11   How to get rid of damage type?
Reply With Quote #1

when friendlyfire,
the screen just bound up and down.

I want to prevent this.

how to do that

I've tried SDKHooks_OnTakeDamage

and set the damage 0.
Predailien12 is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 08-27-2011 , 08:20   Re: How to get rid of damage type?
Reply With Quote #2

Try SDKHooks_OnTakeDamage and use return Plugin_Handled or Plugin_Stop, whatever stops it.
AtomicStryker is offline
Predailien12
Senior Member
Join Date: Feb 2010
Location: Your as* hol*
Old 08-28-2011 , 09:35   Re: How to get rid of damage type?
Reply With Quote #3

Quote:
Originally Posted by AtomicStryker View Post
Try SDKHooks_OnTakeDamage and use return Plugin_Handled or Plugin_Stop, whatever stops it.
But I'm going to apply some functions for the victim.
So the victim must be hurt but no damage.
and gonna make his screen not bound

but only preventing screen bounding doesn't work.
Predailien12 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-28-2011 , 10:10   Re: How to get rid of damage type?
Reply With Quote #4

What if you change hitbox ? Haven't tested though
*edit
traceattack

*edit
Try set damageforce[3] to zero on OnTakeDamage

*edit this is horrible code... maybe if better you give them helmet.
PHP Code:
#include <sdkhooks>

new victim_hitgroups[MAXPLAYERS];

public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    
SDKHook(clientSDKHook_TraceAttackTraceAttack);
}

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])
{
    if(
GetClientTeam(attacker) == GetClientTeam(victim) && victim_hitgroups[victim] == 1)
    {
        
damageForce[0] = 0.0;
        
damageForce[1] = 0.0;
        
damageForce[2] = 0.0;
        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;
}

public 
Action:TraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotypehitboxhitgroup)
{
    
victim_hitgroups[victim] = hitgroup;

__________________
Do not Private Message @me

Last edited by Bacardi; 08-28-2011 at 11:00.
Bacardi is offline
Predailien12
Senior Member
Join Date: Feb 2010
Location: Your as* hol*
Old 08-28-2011 , 14:53   Re: How to get rid of damage type?
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
What if you change hitbox ? Haven't tested though
*edit
traceattack

*edit
Try set damageforce[3] to zero on OnTakeDamage

*edit this is horrible code... maybe if better you give them helmet.
PHP Code:
#include <sdkhooks>
 
new victim_hitgroups[MAXPLAYERS];
 
public 
OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_OnTakeDamageOnTakeDamage);
    
SDKHook(clientSDKHook_TraceAttackTraceAttack);
}
 
public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3])
{
    if(
GetClientTeam(attacker) == GetClientTeam(victim) && victim_hitgroups[victim] == 1)
    {
        
damageForce[0] = 0.0;
        
damageForce[1] = 0.0;
        
damageForce[2] = 0.0;
        return 
Plugin_Changed;
    }
 
    return 
Plugin_Continue;
}
 
public 
Action:TraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotypehitboxhitgroup)
{
    
victim_hitgroups[victim] = hitgroup;

Thank you for your help.
but the force can't be changed.
I learned that only &-attached variables can be changed.
but the force has no & of its head
Predailien12 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-28-2011 , 14:57   Re: How to get rid of damage type?
Reply With Quote #6

Quote:
Originally Posted by Predailien12 View Post
Thank you for your help.
but the force can't be changed.
I learned that only &-attached variables can be changed.
but the force has no & of its head
Hmm, that seem affect ragdoll when playe die..
__________________
Do not Private Message @me
Bacardi is offline
Predailien12
Senior Member
Join Date: Feb 2010
Location: Your as* hol*
Old 08-28-2011 , 15:42   Re: How to get rid of damage type?
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
Hmm, that seem affect ragdoll when playe die..
Well
When I changed the victim like this..

PHP Code:
OnTakeDamage/* Variables */ )
{
      if(
attacker MaxClients)
      {
             if(
GetClientTeam(attacker) == TEAM_INFECTED)
             {
                    
SDKHooks_TakeDamage(clientattackerattackerdamagedamagetype)//client is not a victim. client is a global variable.
                    
damage *= 0;
                    return 
Plugin_Changed;
             }
      }

it worked very well.
the client takes every effect instead of victim.
even the shaking of screen.

but when the attacke team is survivors and the victim is survivors
(of course the victim above php is on survivors team, too)
it's not working.

why?

Also, tried return Plugin_Handled and Stop, it's not working.

here is my source code
PHP Code:
else if(VictimTeam == TEAM_SURVIVORS && AttackerTeam == TEAM_SURVIVORS)
{
     
GetClientWeapon(attackersWeaponsizeof(sWeapon))
     if(
damagetype DMG_BULLET || StrEqual(sWeapon"weapon_melee"true))
     {
        new 
VictimJob Jobs[victim];
        new 
AttackerJob Jobs[attacker];
        if(
AttackerJob == 1)
        {
            if(
VictimJob == || VictimJob == || VictimJob == 3)
            {
                
HealingTeam(victimattackersWeapon);
            }
        }
 
        
damage *= 0.0;
        return 
Plugin_Changed;
   }
 
   return 
Plugin_Continue;

Or Is there any way to prevent one from being hurt when friedly fire?

Last edited by Predailien12; 08-28-2011 at 15:47.
Predailien12 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 10:24.


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