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

Solved [TF2] A better way to kill players


Post New Thread Reply   
 
Thread Tools Display Modes
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 07-06-2016 , 01:46   Re: [TF2] A better way to kill
Reply With Quote #11

Maybe this ?

attacker could be victim or 0
PHP Code:
stock void Client_TakeDamage(int victim,int attackerint damage,int dmg_type DMG_GENERIC, const char[] weapon)
{
  if(
IsValidClient(victim) && IsValidClient(attacker))
  {
    
char sDamage[16];
    
char sDamageType[32];
    
IntToString(damagesDamagesizeof(sDamage));
    
IntToString(dmg_typesDamageTypesizeof(sDamageType));
    
int index CreateEntityByName("point_hurt");
    if(
index)
    {
      
DispatchKeyValue(victim,"targetname","cod_hurtme");
      
DispatchKeyValue(index,"DamageTarget","cod_hurtme");
      
DispatchKeyValue(index,"Damage"sDamage);
      
DispatchKeyValue(index,"DamageType",sDamageType);
      
DispatchKeyValue(index,"classname",weapon);
      
DispatchSpawn(index);
      
AcceptEntityInput(index,"Hurt"attacker);
      
DispatchKeyValue(index,"classname","point_hurt");
      
DispatchKeyValue(victim,"targetname","cod_donthurtme");
      
RemoveEdict(index);
    }
  }

ESK0 is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 08-09-2016 , 10:56   Re: [TF2] A better way to kill
Reply With Quote #12

Quote:
Originally Posted by ESK0 View Post
Maybe this ?

attacker could be victim or 0
PHP Code:
stock void Client_TakeDamage(int victim,int attackerint damage,int dmg_type DMG_GENERIC, const char[] weapon)
{
  if(
IsValidClient(victim) && IsValidClient(attacker))
  {
    
char sDamage[16];
    
char sDamageType[32];
    
IntToString(damagesDamagesizeof(sDamage));
    
IntToString(dmg_typesDamageTypesizeof(sDamageType));
    
int index CreateEntityByName("point_hurt");
    if(
index)
    {
      
DispatchKeyValue(victim,"targetname","cod_hurtme");
      
DispatchKeyValue(index,"DamageTarget","cod_hurtme");
      
DispatchKeyValue(index,"Damage"sDamage);
      
DispatchKeyValue(index,"DamageType",sDamageType);
      
DispatchKeyValue(index,"classname",weapon);
      
DispatchSpawn(index);
      
AcceptEntityInput(index,"Hurt"attacker);
      
DispatchKeyValue(index,"classname","point_hurt");
      
DispatchKeyValue(victim,"targetname","cod_donthurtme");
      
RemoveEdict(index);
    }
  }

This actually works. Thanks.

Now I have to somehow make trigger_hurt ignore assistances as well.
__________________

Last edited by luki1412; 08-09-2016 at 11:08.
luki1412 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 18:59.


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