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

return damage.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 06-25-2009 , 09:31   return damage.
Reply With Quote #1

Is it possible to make a plugin that can return damage like when a attacker hit victim the attacker will get slap.
__________________
ƒa†es™ is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 06-25-2009 , 09:35   Re: return damage.
Reply With Quote #2

Oo

you can find it in the wiki

http://wiki.amxmodx.org/Half-Life_1_Game_Events#Damage


Quote:
Called when a player takes damage, to display the red locational indicators. The last three arguments is the origin of the damage inflictor or victim origin if inflictor isn't found. DamageType is a bitwise value usually consist of a single bit.


Note: To caputure this message,you should use "b" as the third parameter in the register_event() function.

Quote:
Name: Damage
Structure: byte DamageSave
byte DamageTake
long DamageType
coord CoordX
coord CoordY
coord CoordZ
And for Ham i guess is

Quote:
* Description: Usually called whenever an entity gets attacked by a hitscan (such as a gun) weapon.
* Use the get/set tr2 natives in fakemeta to handle the traceresult data.
* Do not use a handle of 0 as a traceresult in execution, use create_tr2() from Fakemeta
* to pass a custom handle instead. (Don't forget to free the handle when you're done.)
* Forward params: function(this, idattacker, Float:damage, Float:direction[3], traceresult, damagebits)
* Return type: None.
* Execute params: ExecuteHam(Ham_TraceAttack, this, idattacker, Float:damage, Float:direction[3], tracehandle, damagebits);
*/
Ham_TraceAttack,
xD

P.S : what is your Garena ACC?
__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 06-25-2009 at 09:41.
--kml-- is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-25-2009 , 10:20   Re: return damage.
Reply With Quote #3

PHP Code:
#pragma semicolon 1
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
public plugin_init()
{
 
register_plugin("Return Damage","0.1""shadow.hk");
 
 
RegisterHam(Ham_TakeDamage,"player","fwdHamTakeDamage",1);
}
public 
fwdHamTakeDamage(iVictiminflictoriAttackerFloat:iDamagebitDamage)
{
 new 
iHealth get_user_health(iAttacker);
 
 if(!(
<= iAttacker <= get_maxplayers()))
  return 
HAM_IGNORED;
 
 if(
get_user_team(iVictim) == get_user_team(iAttacker))
 {
  if(
iHealth iDamage <= 0)
   
user_silentkill(iAttacker);
 
  if(
is_user_alive(iAttacker))
   
set_pev(iAttacker,pev_health,iHealth iDamage);
 
  return 
HAM_SUPERCEDE;
 }
 
 return 
HAM_IGNORED;

Depending on what you want it for specifically... that script is for team attackers. Just change get_user_team to what you want, or any other conditional.
shadow.hk is offline
Send a message via MSN to shadow.hk
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 06:00.


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