Raised This Month: $ Target: $400
 0% 

Setting the same TraceLine twice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-03-2008 , 11:28   Setting the same TraceLine twice
Reply With Quote #1

Can I do this:
PHP Code:

set_tr2
(traceTR_pHitid);
set_tr2(traceTR_pHitent); 
?
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-03-2008 , 11:33   Re: Setting the same TraceLine twice
Reply With Quote #2

What are you trying to accomplish?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-03-2008 , 13:24   Re: Setting the same TraceLine twice
Reply With Quote #3

Well, I want that when a player attacks an enemy and hit him, it will also damage the nearest player to the enemy (if the nearest player is an enemy as well). So I wanted to make sure it will hit the original target for 100%, along with the nearest enemy to the victim.

Or maybe I can simply get the damage of the attack from Ham_TakeDamage and use: set_user_health(ent, get_user_health(ent) - damage)?
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯

Last edited by Dores; 09-03-2008 at 13:26.
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-03-2008 , 15:31   Re: Setting the same TraceLine twice
Reply With Quote #4

Quote:
Originally Posted by dor123 View Post
Or maybe I can simply get the damage of the attack from Ham_TakeDamage and use: set_user_health(ent, get_user_health(ent) - damage)?
That would be easiest.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-03-2008 , 17:30   Re: Setting the same TraceLine twice
Reply With Quote #5

Or use ExecuteHam(Ham_TakeDamage,...) to avoid health bug.
Alka is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-03-2008 , 17:33   Re: Setting the same TraceLine twice
Reply With Quote #6

Quote:
Originally Posted by Alka View Post
Or use ExecuteHam(Ham_TakeDamage,...) to avoid health bug.
Ok i'll try them both, thanks guys

EDIT: Can I use ExecuteHam(Ham_TakeDamage,...) on more than one entity? For example using it twice to decrease health for 2 entities?
And where and how am I suppose to use it?
I don't know much about the HamSandwich module...
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯

Last edited by Dores; 09-03-2008 at 17:37.
Dores is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-03-2008 , 17:52   Re: Setting the same TraceLine twice
Reply With Quote #7

Code:
Ham_TakeDamage
  * Execute params: ExecuteHam(Ham_TakeDamage, this, idinflictor, idattacker, Float:damage, damagebits);
yes, of course you can, you must get the index of entity and execute the func.
Alka is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 09-03-2008 , 17:59   Re: Setting the same TraceLine twice
Reply With Quote #8

this = victim?
and who is the idinflictor? what is the difference between inflictor and attacker?
and can I use this message/event in any function I want?

Sorry for all the questions, I'm still learning... Gladly from you and Exolent.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯

Last edited by Dores; 09-03-2008 at 18:01.
Dores is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 09-03-2008 , 18:03   Re: Setting the same TraceLine twice
Reply With Quote #9

Quote:
Originally Posted by dor123 View Post
this = victim?
and who is the idinflictor? what is the difference between inflictor and attacker?
and can I use this message/event in any function I want?

Sorry for all the questions, I'm still learning... Gladly from you and Exolent.
Inflictor = Entity used to do the damage. Normally the index of the player weapons. Attacker is the player wielding the weapon.
danielkza is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-03-2008 , 18:06   Re: Setting the same TraceLine twice
Reply With Quote #10

this = entity being damaged
idinflictor = entity causing damage
attacker = entity causing idinflictor to cause damage

------------------

Example:
Player2 shoots Player1:

this = Player1
idinflictor = Player2
attacker = Player2

Note: With guns, the inflictor and attacker are the same. But with grenades, the inflictor is the grenade entity index.

------------------

Example:
Player1 falls from a high spot and gets hurt

this = Player1
idinflictor = Player1 (or 0, cant remember)
attacker = Player1 (or 0, cant remember)

Note: To check if player fell, use the 5th parameter "damagebits":
Code:
public EventTakeDamage(client, inflictor, attacker, Float:damage, damagebits) {     if( damagebits & DMG_FALL )     {         // player fell     } }


EDIT:
Quote:
Originally Posted by danielkza View Post
Inflictor = Entity used to do the damage. Normally the index of the player weapons. Attacker is the player wielding the weapon.
It is never the index of a weapon unless it is a grenade.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 09-03-2008 at 19:31.
Exolent[jNr] is offline
Old 09-03-2008, 18:06
Exolent[jNr]
This message has been deleted by Exolent[jNr]. Reason: oops, double
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 03:10.


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